Forum Discussion

CamIAm88's avatar
CamIAm88
Regular Visitor
3 years ago
Solved

Help with ranking Employees for each group using RANKX

I have a dashboard created where the user selects an employee and a table displays metrics for all the work groups worked by that employee. I would like to add a column to the table on my dashboard t...
  • v-jianboli-msft's avatar
    3 years ago

    Hi CamIAm88 ,

     

    Please try:

    RankEmployee =
    VAR _a =
        ADDCOLUMNS (
            ALL ( Table_1 ),
            "Rank",
                RANKX (
                    FILTER ( ALL ( Table_1 ), [Work_Group] = EARLIER ( Table_1[Work_Group] ) ),
                    [KPI]
                )
        )
    RETURN
        MAXX (
            FILTER (
                _a,
                [Employee] = MAX ( 'Table_1'[Employee] )
                    && [Work_Group] = MAX ( 'Table_1'[Work_Group] )
            ),
            [Rank]
        )
    

     

    Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.