Forum Discussion

Ruedi007's avatar
Ruedi007
Frequent Visitor
6 years ago
Solved

Auto rank rows durning slicing

Hi! I have a table where I have three columns ordered by Inhabitants   1. State 2. City 3. Inhabitants   What I need is a column Rank that just starts with 1 and ends with the number of the la...
  • v-lionel-msft's avatar
    v-lionel-msft
    6 years ago

    Hi Ruedi007 ,

     

    Please create two measures like this.

    Current_Inhabitants = MAX(Sheet1[Inhabitants])
    _Rank = 
    RANKX(
        ALLSELECTED(Sheet1),
        [Current_Inhabitants],
        , DESC, Dense
    )

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.