Forum Discussion
RANKX
I'm struggling to figure out how to properly use RankX.
Here is a test table I created with names and points.
I'd like to sum the total points for each name and then rank them.
I tried this with the measure
Hi,
create a measure
SumOfPoints = SUM(TestTable[Points])and change your rank
Rank = RANKX(ALL(TestTable[Name]), [SumOfPoints])Please see RANKX – DAX Guide for more information, the part why i use an extra measure:
The Expression argument is evaluated in a row context: while a measure reference implies a context transition, an explicit CALCULATE might be necessary using aggregation functions such as SUM.
1 Reply
- lukiz84Memorable Member
Hi,
create a measure
SumOfPoints = SUM(TestTable[Points])and change your rank
Rank = RANKX(ALL(TestTable[Name]), [SumOfPoints])Please see RANKX – DAX Guide for more information, the part why i use an extra measure:
The Expression argument is evaluated in a row context: while a measure reference implies a context transition, an explicit CALCULATE might be necessary using aggregation functions such as SUM.