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.
Hello,
I'm looking for your help on coming up with a Matix or Table visualization that shows the sum of top 5, top 10 and top 15. I have the following Percentage column that has percentages sorted in descending order which I'm using to solve this issue. I tried doing it myselft but Power BI desktop keep saying that you only can use one TopN from the UI. So, I was thinking maybe there is a way to do it using DAX formula.
Thank you.
Here is the data that can be copied.
Percentage | ||||||
10.31% | ||||||
9.65% | ||||||
8.62% | ||||||
7.85% | ||||||
7.80% | ||||||
6.74% | ||||||
6.10% | ||||||
6% | ||||||
5.62% | ||||||
5.60% | ||||||
5.21% | ||||||
5.21% | ||||||
4.80% | ||||||
4.65% | ||||||
4.30% | ||||||
3.50% | ||||||
3.21% | ||||||
3.12% | ||||||
3.10% | ||||||
2.52% | ||||||
2.35% | ||||||
2.10% | ||||||
2% | ||||||
1.30% | ||||||
1.20% | ||||||
0.83% | ||||||
0.65% | ||||||
0.64% | ||||||
0.12% |
Solved! Go to Solution.
Create a measure for each band as follows:
Top 5 =
SUMX (
CALCULATETABLE (
TOPN ( 5, VALUES ( Table[Percentage] ), Table[Percentage], DESC )
),
Table[Percentage]
)
Change 5 with the band size you want for each measure.
Create a measure for each band as follows:
Top 5 =
SUMX (
CALCULATETABLE (
TOPN ( 5, VALUES ( Table[Percentage] ), Table[Percentage], DESC )
),
Table[Percentage]
)
Change 5 with the band size you want for each measure.
Hi Mohammad, Thank you so much for above DAX query. It's working perfectly for me.
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 |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |