Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Community,
I am trying to create a calculated column to deliver a rank. I have a table of data the looks something like this...
Test ID | Run ID |
1 | 5 |
1 | 8 |
1 | 3 |
2 | 6 |
2 | 3 |
2 | 1 |
3 | 1 |
3 | 5 |
3 | 9 |
And Im looking to rank the Run ID from highest value to lowest for each Test ID, the expected table would show...
Test ID | Run ID | Rank |
1 | 5 | 2 |
1 | 8 | 3 |
1 | 3 | 1 |
2 | 6 | 3 |
2 | 3 | 2 |
2 | 1 | 1 |
3 | 1 | 1 |
3 | 5 | 2 |
3 | 9 | 3 |
Any help from the community is much apperciated!!
Solved! Go to Solution.
@wayersGM , Try new Rank
Rank = rankx(filter(Table, [Test ID] = earlier([Test ID]) ), [Run ID] )
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new column.
Rank CC =
VAR currentTestID = Data[Test ID]
VAR withinTestID_Table =
FILTER ( Data, Data[Test ID] = currentTestID )
RETURN
RANKX ( withinTestID_Table, Data[Run ID],, ASC )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thanks for the help! Both solutions work as expected.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new column.
Rank CC =
VAR currentTestID = Data[Test ID]
VAR withinTestID_Table =
FILTER ( Data, Data[Test ID] = currentTestID )
RETURN
RANKX ( withinTestID_Table, Data[Run ID],, ASC )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@wayersGM , Try new Rank
Rank = rankx(filter(Table, [Test ID] = earlier([Test ID]) ), [Run ID] )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |