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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello PBI-experts,
I cannot seem to fix the issue. Following constellation results in a wrong grand total in my matrix:
I have a ranking based on different dimensions (dynamic x-axis) as:
Ranking Dimensions = SWITCH(SELECTEDVALUE('X-Axis'[Dimension],BLANK()), "A",RANKX(ALLSELECTED('DIM_A'[Name]),[Switch KPI],,DESC,DENSE),
"B",RANKX(ALLSELECTED('DIM_B'[Name]),[Switch KPI],,DESC,DENSE),
"C",RANKX(ALLSELECTED('DIM_C'[Name]),[Switch KPI],,DESC,DENSE) )And the measure in the matrix as:
Dynamic Ranking = SUMX(VALUES('X-Axis'[X-Axis]),
IF([Ranking Dimensions]<='X-Axis Ranking TopN'[X-Axis Ranking TopN Value], [Switch KPI]))The slicer works as expected and throws the top N rows, however in the grand total row it misses the context of the TopN slicer and sums up everything.
Any suggestions what I could do?
Thanks alot!
Solved! Go to Solution.
If someone comes across the same issue I´ve figured it out by creating another measure and using it in the filter pane:
If someone comes across the same issue I´ve figured it out by creating another measure and using it in the filter pane:
This may solve it
Dynamic Ranking =
VAR SelectedAxis = SELECTEDVALUE('X-Axis'[X-Axis])
RETURN
SUMX(VALUES('X-Axis'[X-Axis]),
IF (
NOT ISFILTERED('X-Axis'[X-Axis]) || 'X-Axis'[X-Axis] = SelectedAxis,
IF (
[Ranking Dimensions] <= 'X-Axis Ranking TopN'[X-Axis Ranking TopN Value],
[Switch KPI],
BLANK()
),
BLANK()
)
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 29 | |
| 21 | |
| 12 | |
| 12 |