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 last column. This column must adjust automatically during slicing. Let us say my slicer is "States" and I click on NewYork. Now I want to see all the citys ordered by inhabitants but I need a column 1..x so I can see the rank of each city.

 

I hope I could make myself clear enough. Is that possible?

 

Best

  • 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.

     

3 Replies