measure to concatenate the top ten customer names and their profit to use in a tooltip

ruthhacche

Board Regular
Joined
Sep 22, 2017
Messages
84
I feel like I may be close on this (but am probably a million miles away). I want to create a concatenated text list of the top 10 customer names and their profit to appear in a tooltip.

Top 10 Customers =
var LIST =VALUES(Customer[ACCOUNT Name])
var profit = CALCULATE([SF Profit],ALLSELECTED('Calendar'[FiscalYear]))
var shortlist = topn(10,LIST,profit,DESC)
return
CONCATENATEX(shortlist,[ACCOUNT Name] & FORMAT(profit," £#,##0"),unichar(10) ,[SF Profit],DESC
)

I get all customers (if there is more than 10) and all profit. So in the tip below there were only two customers in that year but it lists all 4 customers from across all years and each one has the total profit for all 4 customers for all 4 years. How do I filter the profit to customers and to fiscal year. It is going to be incredibly excellent when it works!

1611941067150.png
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I was closer when I did this but it is doing the list for all fiscal years not just the one selected.

Top 10 Customers1 =
var LIST =VALUES(Customer[ACCOUNT Name])
var shortlist = topn(10,LIST,[SF Profit],DESC)
return
CONCATENATEX(shortlist,[ACCOUNT Name] & FORMAT([SF Profit]," £#,##0"),unichar(10) ,[SF Profit],DESC
)
 
Upvote 0
Solved it!

Top 10 Customers1 =
var LIST =VALUES(Customer[ACCOUNT Name])
var shortlist = filter(topn(10,LIST,[SF Profit],DESC),[SF Profit]>0)
return
CONCATENATEX(shortlist,[ACCOUNT Name] & FORMAT([SF Profit]," £#,##0"),unichar(10) ,[SF Profit],DESC
)


1611941795358.png
 
Upvote 0
Solution

Forum statistics

Threads
1,215,335
Messages
6,124,327
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top