I have a Table with two Columns:
If I create a measure with RankX I get a Rank over the complete table, sorted by value. Everything is fine.
Table with Category, Value and Rank
RankX_Table Dax:
RankX_Category = RANKX(all(RankX_Dummy[Category]), [Total_Value]
)
I want to create a Rank by Category. If I create a measure for this the Rank just shows '1'
Table with Category, Value, Rank_Table, Rank_Category
| Category | Value | Total_Value | RankX_Table | RankX_Category
| A | 100 | 100 | 3 | 1
| A | 150 | 150 | 1 | 1
| B | 50 | 50 | 9 | 1
| B | 55 | 55 | 8 | 1
| B | 100 | 100 | 3 | 1
etc.
RankX_Category Dax:
RankX_Category = RANKX(all(RankX_Dummy[Category]), [Total_Value])
I think I miss a detail but I have no Idea what.
Try this.
RankX_Category2 =
VAR t = CALCULATETABLE(RankX_Dummy, REMOVEFILTERS(RankX_Dummy), VALUES(RankX_Dummy[Category]))
RETURN
RANKX(t, [Total_Value] )