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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,223,742
Messages
6,174,240
Members
452,553
Latest member
red83

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