Become a DAX guru

RANKX DAX Function (Statistical)

Returns the rank of an expression evaluated in the current context in the list of values for the expression evaluated for each row in the specified table.


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

A table expression.

Row Context

An expression that will be evaluated for row of the table.

Value Optional

An expression that will be evaluated in the current context. If omitted, the Expression argument will be used.

Order Optional

The order to be applied. 0/FALSE/DESC – descending; 1/TRUE/ASC – ascending.

Ties Optional

Function behavior in the event of ties. Skip – ranks that correspond to elements in ties will be skipped; Dense – all elements in a tie are counted as one.

Return values

Scalar A single integer value.

The rank number of Value among all possible values of Expression evaluated for all rows of Table numbers.


The default value for the Order argument is DESC.
The default value for the Ties argument is SKIP.

Related articles

Learn more about RANKX in the following articles:

Related functions

Other related functions are:

Last update: Oct 19, 2020   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber

MSDN documentation:

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.


Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.


This function is deprecated. Jump to the Alternatives section to see the function to use.


This parameter is deprecated and its use is not recommended.


Want to improve the content of RANKX? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.