Forum Discussion

datawiz23's avatar
datawiz23
Frequent Visitor
2 years ago
Solved

Rank DAX problem in Power BI

This problem has been sending me potty.   I know it should be relatively be simple but I can't crack it, originally I tried to solve it using RANKX but I couldn't get it to work so I tried RANK and...
  • Fowmy's avatar
    Fowmy
    2 years ago

    datawiz23 

    Create the following measure to rank by Rating under each Country:

    Uni Rank = 
    VAR __T = ALLSELECTED( 'Table' )
    VAR __Result = 
        RANK( 
             DENSE,
            __T ,
            ORDERBY('Table'[World Rank in Year],ASC),,
            PARTITIONBY( 'Table'[country])
        )
    RETURN
        __Result

    File attached below