March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Team,
We are facing an issue when using the RANKXX function to calculate the Rank. We have a dataset that contains the Hotel Sales at each hotel that falls in a State. When all the Hotels or all the States are selected through the slicer, RankXX works fine but when only one state is selected through the slicer, even though Rank should be 1 for one particular state but it displays it as 2.
Measures Definition area as follow
SRS_New = IF( HASONEVALUE(ParkNames[Park Codes-Park Name]),BLANK(),Sales_aggregateData[Sales Rank By State_new])
Sales Rank By State_new = IF (
ISBLANK(Sales_aggregateData[Booking_Total_SUM]),
BLANK(),CALCULATE(RANKX (ALL(States[States]),Sales_aggregateData[Booking_Total_SUM],,DESC),ALL(ParkNames[Park Codes-Park Name])))
Below is the sample data
State ParkName Booking_Total_SUM
ABC ABC_123 100
ABC ABC_456 150
DEF DEF_123 50
ABC DEF_456 70
Please let us know if any more information is needed.
Thanks,
Neeraj
Solved! Go to Solution.
Hi @neeraj068 ,
Modify your measure as below:
Measure =
RANKX(ALLSELECTED('ParkNames'),CALCULATE(SUM('ParkNames'[Booking_Total_SUM])),,ASC,Dense)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @neeraj068 ,
Modify your measure as below:
Measure =
RANKX(ALLSELECTED('ParkNames'),CALCULATE(SUM('ParkNames'[Booking_Total_SUM])),,ASC,Dense)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi, @neeraj068
I am not sure if I correctly understand your DAX measure, but please try to use ALLSELECT , instead of ALL, in front of (States[States]).
When you want to filter the ranking by the states-slicer, then I believe ALLSELECT is the correct option.
I hope this helped.
Or, please kindly share your sample pbix file then I can try to have a look and come up with a desirable solution.
Thank you very much.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @neeraj068 ,
Could you please provide your pbix file so that I can look into it...?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
90 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |