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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.