Forum Discussion
Help with ranking Employees for each group using RANKX
- 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.
CamIAm88 , The measure you provided should work with small change
RankEmployee =
RANKX(
FILTER(
ALL(Table_1[Employee_A], (Table_1[Work_Group]),
Table_1[Work_Group] = MAX(Table_1[Work_Group])
)),
CALCULATE( SUM( Table_1[KPI]) ) -- Note actual calculate simplified for example
)
Thank you for your quick response Amit. There was a typo in my DAX after rewriting it for the post but where I'm having the issue is with the results. The DAX designates a rank 1 to all work groups.
I would like for the measure to compare the KPI for the selected employee to that of all employees per Work_Group.