Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RAHEEL
Helper I
Helper I

Rank a column but in case of same values consider another column too for ranking

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

resourceExpAgeRankingColumn
R111403
R210384
R311421
R46284
R511412
R65265

 

 

Regards,

Raheel

 

2 ACCEPTED SOLUTIONS

Hi @RAHEEL

 

In that case

 

First Add an Index Column to your Table Using QueryEditor/Power Query

 

53.png

 

Now you can use this formula

 

RANK=
RANKX (
    Table1,
    Table1[Exp]
        + Table1[Age] / 100
        + Table1[Index] / 1000,
    ,
    DESC,
    DENSE
)

View solution in original post

@RAHEEL

 

See the pic below

I added one row with same experience and age

 

54.png

 

View solution in original post

6 REPLIES 6
Zubair_Muhammad
Community Champion
Community Champion

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 )

33.png

@RAHEEL

 

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

 

53.png

 

Now you can use this formula

 

RANK=
RANKX (
    Table1,
    Table1[Exp]
        + Table1[Age] / 100
        + Table1[Index] / 1000,
    ,
    DESC,
    DENSE
)

@RAHEEL

 

See the pic below

I added one row with same experience and age

 

54.png

 

Perfectooooo 🙂 this worked for me 🙂 thanks 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.