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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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