Forum Discussion

Arul's avatar
Arul
Super User
4 years ago
Solved

Rankx Value

Hi,   Can anybody explain what is the exact use of "Value" argument in RANKX Dax function with example?   Thanks, -Arul
  • Greg_Deckler's avatar
    4 years ago

    Arul Well, the way it works is that the value parameter allows you to find the rank of that specific value within all of the values returned by the expression parameter. For example let's say that you have a table with three rows with values of 1, 2 and 3. If you did this:

    Rank Column = RANKX('Table', [Column], 4)
     
    This would return 1 for all columns. Conversely:
    Rank Column = RANKX('Table', [Column], 0)
     
    This would return 4. If you left the value parameter out, then the value of expression at the current row is used instead so that would return 3, 2, 1 respectively for 1, 2, 3.
     
    Why you would ever want to use this? I'm sure there is some use case out there somewhere.