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.
Hi All,
I need help to rank below dataset using dax function in power bi.
I have resources and I want to assign them unique numbers based on their experience, but if more than 1 resource has the same experience then also consider age column and who is elder get the smaller number (i.e. higher rank)
e.g. R1, R3 and R5 all have 11 yrs of exp and will get a normal rank of 1 but I want them to assign 3,1 & 2 ranks respectively as per below data based on their exp and age.
I also donot want to skip any of the sequence in rank numbers.
Kindly assist.
Also, I am not sure if there is anyother of doing the same thing other than Rank function.Last column in RED i.e. RankingColumn is the desired output column. Much appreciated. Thanks
resource | Exp | Age | RankingColumn |
R1 | 11 | 40 | 3 |
R2 | 10 | 38 | 4 |
R3 | 11 | 42 | 1 |
R4 | 6 | 28 | 4 |
R5 | 11 | 41 | 2 |
R6 | 5 | 26 | 5 |
Regards,
Raheel
Solved! Go to Solution.
Hi @RAHEEL
In that case
First Add an Index Column to your Table Using QueryEditor/Power Query
Now you can use this formula
RANK= RANKX ( Table1, Table1[Exp] + Table1[Age] / 100 + Table1[Index] / 1000, , DESC, DENSE )
See the pic below
I added one row with same experience and age
Hi @RAHEEL
Try this technique
Add an Assistant Calculated Column
Assistant Column = Table1[Exp] + Table1[Age] / 100
Now you can Rank using this Column
RANK= RANKX ( Table1, Table1[Assistant Column],, DESC, DENSE )
Infact no need for the Assistant Column.
This Calculated Column should suffice
RANK = RANKX ( Table1, Table1[Exp] + Table1[Age] / 100,, DESC, DENSE )
Perfect....this worked...BUT there is still one issue....where both the age and exp are same it is resulting in the same Rank...any idea how to manage this?
Your time is much appreciated:)
Hi @RAHEEL
In that case
First Add an Index Column to your Table Using QueryEditor/Power Query
Now you can use this formula
RANK= RANKX ( Table1, Table1[Exp] + Table1[Age] / 100 + Table1[Index] / 1000, , DESC, DENSE )
See the pic below
I added one row with same experience and age
Perfectooooo 🙂 this worked for me 🙂 thanks 🙂
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 |
---|---|
113 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |