Forum Discussion

Vish24's avatar
Vish24
Helper II
6 years ago
Solved

Ranking based on measure

Hello,

 

I am trying to do the ranking for sales by people in regions. I am getting correct result if I am showing in table. But I want to make a slicer for a sales persons names and then show the ranking of the selected person . I am getting one in ranking for each person. Its giving me correct result if I am making a table with names and rank.

 

Please 

  • Hi Vish24 ,

     

    At first, you need to add an index coloumn in the query editor.

    Then refer to the following measure:

    Measure =
    MINX (
        FILTER (
            SELECTCOLUMNS (
                ALLSELECTED ( 'Table' ),
                "index", 'Table'[Index],
                "rank", RANKX ( ALLSELECTED ( 'Table' ), 'Table'[Column2],, DESC, DENSE )
            ),
            [index] = MAX ( 'Table'[Index] )
        ),
        [rank]
    )

    Here is my test file for your reference.

     

4 Replies