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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
DPJay
Regular Visitor

Ranking

location ranking.jpg

Hello,

 

I am trying to rank locations using RankX function based on quantity for each location. I'm not sure why I'm getting the same rank for multiple locations although the quantity is different.

Can anyone help me on this?

 

 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

Add the column you are Ranking I couldn't see the name in your picture above.

 

Rank Measure =
IF (
    HASONEVALUE ( FINAL_TBL[Column you are Ranking] ),
    RANKX ( ALL ( FINAL_TBL[Column you are Ranking] ), [TOT_QTY] )
)

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hello everyone,

I am trying to rank my table records in order to standard deviation of a column. The following SS shows how is my generic approach is wrtitten to achieve the rankings and I did the same for median values for the same column and it worked without any problem. So, here is how my function looks like:

 

2019-08-20_14h04_46.png

This returns me 1 as the rank of each record. However when I change STDEV.P to MEDIAN it works pretty well

2019-08-20_14h14_49.png

For more clearance, I am adding indices devided by a big number to prevent having the same rank for same values. That's why you see a sum there.

So, could anyone help me out and explain what is the problem here or how to create a stable ranking function for my tables please?

Thanks in advance,

Cheers!

Sean
Community Champion
Community Champion

Can you post the formulas for the RANK Measure and the TOT_QTY?

DPJay
Regular Visitor

rank.jpgtot_qty.jpg

Sean
Community Champion
Community Champion

Add the column you are Ranking I couldn't see the name in your picture above.

 

Rank Measure =
IF (
    HASONEVALUE ( FINAL_TBL[Column you are Ranking] ),
    RANKX ( ALL ( FINAL_TBL[Column you are Ranking] ), [TOT_QTY] )
)
DPJay
Regular Visitor

Hi Sean,

 

Thanks a lot..it worked Smiley Happy

Sean
Community Champion
Community Champion

Great! Smiley Happy
I added IF ( HASONEVALUE (...) to get rid of the 1 in the Total Row at the bottom of the Visual

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.