Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Ranking a calculated measure in a table visualisation

Hello,   I have the following table as a visualisation but without rank column on the right hand side. Please can you tell me how to add this if the other column is a calculated measure? I've seen ...
  • Greg_Deckler's avatar
    Greg_Deckler
    8 years ago

    Note that I improved this with a non-trivial case of measure ranking, PBIX attached.

     

    Measure Rank 1 = 
    VAR __current = CALCULATE(MAX([Column1]))
    VAR __table = SUMMARIZE(ALL(Table1),[Column1],"__Measure",[Measure])
    VAR __table1 = ADDCOLUMNS(__table,"__Rank",RANKX(__table,[__Measure]))
    RETURN MAXX(FILTER(__table1,[Column1]=__current),[__Rank])