Forum Discussion
CupidC
Helper II
4 years agoShowing Top customers in a Table using TOPN
Hi all I was trying to use TOPN function to show the Top 3 customers in a Table visual, but I couldn't figure it out what is wrong with my formula. any advice would be great 😞 Original Table: ...
- 4 years ago
Hi CupidC
You can just add a simple filter on that visual like this to find those Top 3 items:
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/ - 4 years ago
Hi,
Try these measures
Total = SUM(Data[Sales])Measure = CALCULATE([Total],topn(3,ALL(Data[Customer]),[Total]),VALUES(Data[Customer]))Hope this helps.
Ashish_Mathur
Super User
4 years agoHi,
Try these measures
Total = SUM(Data[Sales])Measure = CALCULATE([Total],topn(3,ALL(Data[Customer]),[Total]),VALUES(Data[Customer]))
Hope this helps.
- CupidC4 years ago
Helper II
HI Ashish
Thanks. could you explain what "VALUES(Data[Customer])" does at the end..
It works, but not sure why it works......
Thanks
Cupid
- Ashish_Mathur4 years ago
Super User
Hi,
The VALUES() function returns a unique list of all the Customers. So while the TOPN function returns the top 3 from among all customers, the return result in the visual just has 3 customers.