Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi all,
See below table, where I have a column Code (text) and a column Name. The aim is to rank the column Name based on the column Code. When column Name doesn't have a unique value, take the minimum of column Code. Column Code doesn't have duplicates. Like this:
Code | Name | Rank |
01.00 | D | 1 |
01.01 | D | 1 |
01.02 | A | 2 |
01.03 | B | 3 |
01.04 | D | 1 |
01.05 | B | 3 |
How can I achieve this?
Solved! Go to Solution.
Hi @PimK ,
Since you don't want to change the Code column as number type. You need to first create column to return number type values.
Then create a column to return min code value group by name.
At last, create the ranking column.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PimK ,
Since you don't want to change the Code column as number type. You need to first create column to return number type values.
Then create a column to return min code value group by name.
At last, create the ranking column.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Stephen!
@PimK Maybe:
Rank = RANKX( 'Table', [Name],,,Dense )
Thank you for the reply Greg.
The code you mentioned sorts on the column Name instead of the column Code..
The rank position for name A should be 2. Your code results in 3 as rank position for name A.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
83 | |
78 | |
54 | |
39 | |
35 |
User | Count |
---|---|
97 | |
80 | |
50 | |
48 | |
48 |