Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |