
Rank
Returns the position (starting from 1) of a specific member or a tuple within a set.
By default, ranks are assigned in ascending order based on the set’s natural order, but you can customize the order using the ORDER()
function.
Syntax
Rank(Member_Expression, Set_Expression)
or
Rank(Tuple_Expression, Set_Expression)
Arguments
Member_Expression | MDX expression that returns a member for which to find the rank. |
---|---|
Tuple_Expression | MDX expression that returns a tuple for which to find the rank |
Set_Expression | MDX expression that returns a set that will be ranked |
Examples
Add ranking to the report rows
The example formula adds rank to the rows.
Rank( CurrentTuple(VisibleRowsSet()), VisibleRowsSet() )
Order by top-ranking Sprints
The example ranks the top-performing Sprints by the number of completed Story Points in the Sprint.
Rank( [Sprint].CurrentMember, Order( Filter( [Sprint].[Sprint].Members, [Measures].[Sprint Story Points completed] > 0 ), [Measures].[Sprint Story Points completed], BDESC ) )
See also
- Function VissibleRowSet()
- Function CurrentTuple()
- Function Order()
- Function Filter()