Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I am trying to create a Rank(Column) by date and by empid with a metric "EO%". Below is the expected result i am looking for.
Date | Emp ID | EO % | Rank |
1/1/2021 | 123 | 10% | 1 |
1/2/2021 | 23 | 20% | 2 |
1/3/2021 | 134 | 30% | 3 |
1/4/2021 | 234 | 40% | 4 |
1/5/2021 | 123 | 23% | 3 |
1/6/2021 | 23 | 22% | 2 |
1/7/2021 | 134 | 54% | 4 |
1/8/2021 | 234 | 11% | 1 |
1/9/2021 | 123 | 7% | 3 |
1/10/2021 | 23 | 3% | 2 |
1/11/2021 | 134 | 8% | 4 |
1/12/2021 | 234 | 2% | 1 |
Can someone help me with this.
Thanks,
Akhil.
Solved! Go to Solution.
Hello @Akhil_1411
Can you please try this:
Sorting_Rank =
RANKX (
FILTER(
ALL(
'Table'[Date]
),
'Table'[Date] = MAX('Table'[Date])
),
[EO%], , ASC, Dense
)
or this:
Sorting Rank = IF (
HASONEVALUE ( 'Table'[Date] ),
RANKX ( ALL ( 'Table'[Date] ), [EO%], , ASC, Dense)
)
Are you sure the rank you show in your message is based on Date and EMP_ID? Every row has a distinct date so in the rank there wouldn't be same values
Please try the following formula:
Sorting_Rank =
RANKX (
FILTER(
ALL(
'Table'[Date], 'Table'[Emp_ID]
),
'Table'[Date] = MAX('Table'[Date]) &&
'Table'[Date] = MAX('Table'[Date])
),
[EO%], , ASC, Dense
)
Thanks for your response. I have made mistake😶 it will be on the one date there will be multiple employees. Corrected table as below.
Date | Emp ID | EO % | Rank |
1/1/2021 | 123 | 10% | 1 |
1/1/2021 | 23 | 20% | 2 |
1/1/2021 | 134 | 30% | 3 |
1/1/2021 | 234 | 40% | 4 |
1/2/2021 | 123 | 23% | 3 |
1/2/2021 | 23 | 22% | 2 |
1/2/2021 | 134 | 54% | 4 |
1/2/2021 | 234 | 11% | 1 |
1/3/2021 | 123 | 7% | 3 |
1/3/2021 | 23 | 3% | 2 |
1/3/2021 | 134 | 8% | 4 |
1/3/2021 | 234 | 2% | 1 |
Hello @Akhil_1411
Can you please try this:
Sorting_Rank =
RANKX (
FILTER(
ALL(
'Table'[Date]
),
'Table'[Date] = MAX('Table'[Date])
),
[EO%], , ASC, Dense
)
or this:
Sorting Rank = IF (
HASONEVALUE ( 'Table'[Date] ),
RANKX ( ALL ( 'Table'[Date] ), [EO%], , ASC, Dense)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
123 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |