Forum Discussion

FrancescaLu's avatar
FrancescaLu
Frequent Visitor
4 years ago
Solved

DAX Ranking by group

Hi,   I'm getting some problems finding the right syntax to create a new column which has to contain ranking values based on another column.   I have a table made like this: Groups Amount ...
  • Jos_Woolley's avatar
    4 years ago

    Hi,

    Calculated Column:

    MyRank =
    VAR ThisGroup = 'Table'[Groups]
    RETURN
        RANKX(
            FILTER(
                'Table',
                'Table'[Groups] = ThisGroup
            ),
            'Table'[Amount],
            ,
            ,
            DENSE
        )

    Regards