Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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:
A | 500 |
A | 300 |
A | 500 |
B | 700 |
B | 200 |
C | 323 |
C | 500 |
C | 300 |
D | 100 |
D | 700 |
D | 300 |
E | 220 |
E | 565 |
E | 667 |
F | 839 |
F | 122 |
My TopN Formula:
Top 3 customer =
Result that I hope for:
Solved! Go to Solution.
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/
Hi,
Try these measures
Total = SUM(Data[Sales])
Measure = CALCULATE([Total],topn(3,ALL(Data[Customer]),[Total]),VALUES(Data[Customer]))
Hope this helps.
Hi,
Try these measures
Total = SUM(Data[Sales])
Measure = CALCULATE([Total],topn(3,ALL(Data[Customer]),[Total]),VALUES(Data[Customer]))
Hope this helps.
HI Ashish
Thanks. could you explain what "VALUES(Data[Customer])" does at the end..
It works, but not sure why it works......
Thanks
Cupid
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.
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/