Forum Discussion
anshusaketsingh
1 year agoFrequent Visitor
Unexpected Ranking Behavior When Adding Dimensions in Power BI
I was working with the RANK function to rank sales by Sub-Category, and it works fine when only Sub-Category is in the table. However, when I add another dimension (like a different field), the ranki...
- 1 year ago
Hi,
Thank you for your message, and in my opinion, please try to write the measures like the attached file.
- 1 year ago
Thanks , this really helps. The issue was never the Rankx but the underlying measure .
[Total Saless All Except Sub-Cat With Slicer]=CALCULATE([Total Sales], ALLSELECTED(Orders),VALUES(Orders[Sub-Category]))
Once I changed that , RankX worked like a charm without need to summarizeSub-Category Ranking =
RANKX( ALLSELECTED ( Orders[Sub-Category]), [Total Saless All Except Sub-Cat With Slicer],,,Dense)
Jihwan_Kim
1 year agoSuper User
Hi,
Thank you for your message, and in my opinion, please try to write the measures like the attached file.
anshusaketsingh
1 year agoFrequent Visitor
Thanks , this really helps. The issue was never the Rankx but the underlying measure .
[Total Saless All Except Sub-Cat With Slicer]=CALCULATE([Total Sales], ALLSELECTED(Orders),VALUES(Orders[Sub-Category]))
Once I changed that , RankX worked like a charm without need to summarize
Sub-Category Ranking =
RANKX( ALLSELECTED ( Orders[Sub-Category]), [Total Saless All Except Sub-Cat With Slicer],,,Dense)