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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
thne123
Helper III
Helper III

RANKX skipping number even when values are different

I have an issue where I've created a RANKX measure that at seemingly random skips a number/rank even though the measure/value that it's ranking on is different. 

The base value/measure:

 

Avg A= AVERAGE(v_Sales[A]) / 1000

 

Rank measure:

 

Rank_ValueA = 
RANKX(
    FILTER(
        ALLEXCEPT('v_Stores', dimMarket[Market]),
        [Avg A] > 0
    ),
    [Avg A],
    ,
    ,
    Dense
)

 

 Since I have different markets I want to rank within that market, which is why I have the "ALLEXCEPT"

 

Example of where it goes wrong, 47 is missing (first column is ID)

thne123_0-1723801876494.png

 

Another example, 60 is missing

 

thne123_1-1723801917961.png

On the table I have a filter for that market and a datefilet

1 ACCEPTED SOLUTION

Update, I'm stupid, realised there was a global filter that affected the ranking, which I didn't think would affect... 

So incorportated that into the rank and now it's correct 

View solution in original post

7 REPLIES 7
lbendlin
Super User
Super User

What is

 

ALLEXCEPT('v_Stores', dimMarket[Market])

 

supposed to accomplish?

@lbendlin 

So that it ranks per market and not the total, at least that's the plan

You'd need to summarize rather than filter.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Here's an excel I hope is adequate 

https://www.transfernow.net/dl/20240816h0BBgLOA 

Thanks

That Excel file only has Store No. and Value columns.  Seems to be missing the Market column?

Oh, yeah for this example they're all in the same market. Since I want to have separate matrixes for all markets and rank per market

Update, I'm stupid, realised there was a global filter that affected the ranking, which I didn't think would affect... 

So incorportated that into the rank and now it's correct 

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.