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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

Reply
tenzan
Frequent Visitor

Seeking help to create a ranking measure that doesnt change with selection in other tables

Dear Power BI Community,

I am looking for assistance in finding a solution that calculates the vendor rankings while maintaining the same values, regardless of whether a specific vendor is selected in other visuals or not. Any help or guidance would be greatly appreciated.


Below is the DAX measure I have tried, which produces correct rankings when no vendor is selected but changes slightly (usually by 1) when a specific vendor is chosen:

Ranking Transaction=
IF (
    ISINSCOPE (Sheet1[_VENDOR_NAME] ),
    RANKX (
        ALL (Sheet1[_VENDOR_NAME] ),
        CALCULATE ( SUM (Sheet1[_TRANSACTION_VALUE] ) ),
        ,
        DESC,
        DENSE
    )
)


Visual example: before nothing is selected

 New YorkLondonTokyo
Vendor A133
Vendor B222
Vendor C311

 

 

Ideally, when vendor C is selected in other visuals or from the slicer, the table should produce

 New YorkLondonTokyo
Vendor C311

But instead, i get something like this, which is slighly off by 1 for both London and Tokyo. 

 
 New YorkLondonTokyo
Vendor C322

 

5 REPLIES 5
tenzan
Frequent Visitor

Has anyone else encountered a similar issue and found a solution to this? Given the popularity of the ranking measure, i believe there must be someone out ther who can provide guidance. Your assitance would be greaetly appreciated. 

amitchandak
Super User
Super User

@tenzan , Try like

 

RANKX (
filter(ALL (Sheet1[_VENDOR_NAME],Sheet1[_CITY] ),Sheet1[_CITY] = max(Sheet1[_CITY]))
CALCULATE ( SUM (Sheet1[_TRANSACTION_VALUE] ) ),
,
DESC,
DENSE
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I appreciate your time and effort in addressing my concern.

Regrettably, after implementing the DAX query you provided, the issue persists. We continue to see a discrepancy in our table rankings - specifically, an 'off by 1' error for certain countries when a vendor is selected in other visuals.

Despite extensive online research and numerous attempts to resolve this over the past six months, we haven't yet found a successful solution. Considering the importance of data accuracy in our work, this has become a pressing issue.

We are still eager to find a solution or an alternative approach to this problem. If you or anyone else could provide further assistance, it would be greatly appreciated.

Thank you once again for your initial help.



Before 

tenzan_7-1690344834081.png

 

 


After clicking a vendor name in other visuals

tenzan_6-1690344791265.png

 

@tenzan , Try

 

RANKX (
filter(Summarize(ALL(Sheet1), Sheet1[_VENDOR_NAME],Sheet1[_CITY] ),Sheet1[_CITY] = max(Sheet1[_CITY]))
CALCULATE ( SUM (Sheet1[_TRANSACTION_VALUE] ) ),
,
DESC,
DENSE
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak thank you again for checking.

It seems the issue still persists with the new measure using summarize function.

Before
tenzan_0-1690346177801.png

After clicking a vendor name in other visuals

tenzan_2-1690346344056.png

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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