Forum Discussion
SupaJ68
7 years agoNew Member
Rank
Hi PBI Experts, I am trying to rank the data within a table using two different groupings and I am struggling to get the DAX examples on the forum to work for me. Below is an example of my data a...
- 7 years ago
You can use this calculated column for Type 1
RankType1 = RANKX ( SUMMARIZE ( LocationValue, [Location], "Sum", CALCULATE ( SUM ( LocationValue[Value] ) ) ), [Sum], CALCULATE ( SUM ( LocationValue[Value] ), ALLEXCEPT ( LocationValue, LocationValue[Location] ) ), DESC, DENSE ) - 7 years ago
And this one for RANK type 2
See attached file as well
RankType2 = RANKX ( SUMMARIZE ( LocationValue, [SubLocation], "Sum", CALCULATE ( SUM ( LocationValue[Value] ) ) ), [Sum], CALCULATE ( SUM ( LocationValue[Value] ), ALLEXCEPT ( LocationValue, LocationValue[SubLocation] ) ), DESC, DENSE )
Zubair_Muhammad
7 years agoCommunity Champion
You can use this calculated column for Type 1
RankType1 =
RANKX (
SUMMARIZE (
LocationValue,
[Location],
"Sum", CALCULATE ( SUM ( LocationValue[Value] ) )
),
[Sum],
CALCULATE (
SUM ( LocationValue[Value] ),
ALLEXCEPT ( LocationValue, LocationValue[Location] )
),
DESC,
DENSE
)
- Zubair_Muhammad7 years agoCommunity Champion
And this one for RANK type 2
See attached file as well
RankType2 = RANKX ( SUMMARIZE ( LocationValue, [SubLocation], "Sum", CALCULATE ( SUM ( LocationValue[Value] ) ) ), [Sum], CALCULATE ( SUM ( LocationValue[Value] ), ALLEXCEPT ( LocationValue, LocationValue[SubLocation] ) ), DESC, DENSE )- SupaJ687 years agoNew Member
This works perfectly. Thank you!!! :smileyvery-happy: