Forum Discussion

Soof1234's avatar
Soof1234
Helper I
3 years ago
Solved

Make continuous ranking if values are the same

Hi,  Well known issue, but the related posts mostly contain solutions based on a column by adding an index. My problem however, is that I created the ranking based on a measure.    I created a ran...
  • Jihwan_Kim's avatar
    Jihwan_Kim
    3 years ago

    Hi,

    Thank you for your message, and please check the below picture and the attached pbix file.

     

    Rank: =
    VAR _table =
        ADDCOLUMNS (
            ADDCOLUMNS (
                ALL ( Intakes[Sourcers.Title] ),
                "@rankone", CALCULATE ( RANKX ( ALL ( Intakes[Sourcers.Title] ), [Intakes:],, DESC ) ),
                "@ranktwo",
                    CALCULATE (
                        RANKX (
                            ALL ( Intakes[Sourcers.Title] ),
                            CALCULATE ( MAX ( Intakes[Sourcers.Title] ) ),
                            ,
                            ASC
                        )
                    )
            ),
            "@newindex",
                [@rankone] * 100 + [@ranktwo]
        )
    VAR _newtable =
        ADDCOLUMNS ( _table, "@newrank", RANKX ( _table, [@newindex],, ASC ) )
    RETURN
        IF (
            HASONEVALUE ( Intakes[Sourcers.Title] ),
            MAXX (
                FILTER ( _newtable, Intakes[Sourcers.Title] = MAX ( Intakes[Sourcers.Title] ) ),
                [@newrank]
            )
        )