Forum Discussion
yasbos
2 years agoResolver II
Top 5 Salespersons
Hi. I know that similar questions might have been answered. However, this is a bit different. I use live SSAS tabular. I can't create new columns or tables. I have a table where I have salespersons and their amounts. I need a to be able to show the top 5 on a card as a percent of total. For instance the top 5 salespersons account for 60% of the sales. I also would like to list them in a table.
I, perhaps naively, thought that the code would be something as simple as the below. However, the results seem to be wrong because I get different totals from excel, where I know for sure is correct.
Top 5 Sales total =
var Top5=TOPN(5,Sales,[Tot. Sales Amount])
return
SUMX(Top5 ,[Tot. Sales Amount])
Also, would there be a way to handle the ties and to include them all as one? In other words, if, say, three salespersons all had sales of $100k, Then I would like to include them all in their respective rank as per the below illustration?
Thanks so much.
you have to use rank function to filter instead of topn