DAX function
RANK.EQ — DAX function reference
Rank a value within a column.
Syntax
dax
RANK.EQ(<value>, <column>, [<order>])
Examples
dax
RANK.EQ([Sales], ALL(Sales[Amount]))
→ A rank
dax
RANK.EQ(Sales[Amount], ALL(Sales[Amount]), 1)
→ Ascending rank (1 = smallest) via the optional order argument, in a calculated column
More flexible than RANK.EQ for use inside CALCULATE-driven measures rather than a calculated column.
dax
RANKX(ALL(Sales), Sales[Amount])
→ The measure/iterator equivalent of RANK.EQ
Common mistakes & gotchas
- RANK.EQ is designed for calculated columns, ranking a single row value against a column of values in the same table — for measures that need to rank across a filtered/visual-driven table, RANKX is the right tool, not RANK.EQ.
- Tied values receive the same rank, and the next distinct value's rank skips ahead by the number of ties (two rows tied for rank 2 means the next row is rank 4) — there's no dense-rank option built into RANK.EQ the way RANKX offers via its ties argument.
Related DAX functions
From Math & statistics