The RANKX function

Unlike many of the other iterator X functions, RANKX is not just an iterator version of the RANK.EQ function. It offers us much more flexibility in how we can rank our data.

The syntax for the RANKX function is as follows:

RANKX ( <Table>, <Expression> [, <Value>] [, <Order>] [, <Ties>] )

For the first parameter, we need to give a table name or an expression that returns a table. The second parameter is an expression that will evaluate to a scalar value. The function will iterate through the table, ordering the values returned by the expression with a ranking number.

The remaining parameters are all optional. The third parameter is a scalar DAX expression, whose value will be used to find the ranking. If this parameter ...

Get Hands-On Business Intelligence with DAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.