cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmichie
Frequent Visitor

RANKX Assigning Same Rank to Different Values

I've been struggling hard with RANKX for a few days now.  

 

We are connected to a data model, so we're limited to only measures.

 

I'm trying to create a stack rank that just looks at a revenue total and ranks the entire group highest to lowest.

 

However, it keeps giving folks with similar totals the same rank.  It also is skipping values, despite being set to use "Dense" when assigning rank.

 

I've tried troubleshooting it a few different ways, but nothing has worked.

 

Halp!  This is easy to do in Excel and I'm really frustrated that it's so difficult in PBI.

 

Here's my Code:

 

_Rank_All_MTD = 
IF( HASONEVALUE(DimBU[OwnerName]) ,RANKX( ALL(DimBU) ,CALCULATE([_GM_Total_MTD]) ,,,Dense ) )

Here's the Output:

2019-05-09_13-31-57.jpg

 

6 REPLIES 6
ZikoPowerBI
Helper I
Helper I

Did you get the solution for this ?

Thalia
Helper I
Helper I

I had the same problem. Including Dense at the end of the measure fixed it so it rank sequentially. I think it defaults to skip unless you specify. I'm a Power BI newb, but I hope this helps.

Station Factor Rank = RANKX(ALLSELECTED(StationList[STATION]),[Station Factor],,DESC,Dense)
 
I have an issue with RANKX giving the same rank to different values, for instance
 
Value Rank
1 - 4
1 - 3
2 - 3
3 - 2
4 - 1
 
Not sure how to fix this, but I have been trying to understand it for the last 5 hours. I wish it was easy as excel.
 
 
 
 

I found a resolution for RANKX assigning a different rank to the same value. I used Round for the [Station Factor] measure to ignore the decimals more than 2 places.

datagnan
Frequent Visitor

Thanks for that, I was banging my head against the wall!

youssouf
New Member

Hi there,

 

I have excatly the same issue

did you found something ?

 

I really need to fix this !

 

Thanks a lot ^^ 

 

 

v-lili6-msft
Community Support
Community Support

hi, @cmichie 

If there are some filters you have done in the report? what is [_GM_Total_MTD] formula?

Just from a screenshot and rankx formula, we could not find the reason.

If possible share a sample pbix file for us to have a test, or use virtual data to create a sample pbix.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors