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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Cyruslcc
Regular Visitor

Rankx ignoring just one slicer

Hello,

 

I'm trying to create a table as below but encountered a problem that when I add a slicer filter on store, and I filtered a store out, the ranking just become 1, instead of keeping the original ranking, but I also don't want to use ALL cause I want the ranking to be filtered by

Slicer 1: Market and

Slicer 2: Year but

Slicer 3: Store is just intended to let user filter out their store information, this should not change the ranking

 

Now I'm using a rankx for this: Rank = Rankx(allselect('Table'[Store]),[Sales])

 

My apologies on the excel showing, as my dataset is confidential. 

 

Let's say I'm using a dataset like this:

Cyruslcc_0-1729134274011.png

 

And I'd like to create a table with 3 slicers (Year, Market, Store) that shows:

Cyruslcc_1-1729134450560.png

 

While now, when I add a store slicer let's say 1, it will become like this which I want the rank to keep at 3 that's based on Market and Year slicer only.

Cyruslcc_2-1729134632524.png

 

My apologies on the messiness, its my first time asking question here.

Thank you!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Cyruslcc 

 

You can try the following methods.

Rank = 
RANKX(ALLEXCEPT('Table','Table'[Market],'Table'[Year]),CALCULATE(SUM('Table'[Sales])),,DESC)

vzhangtinmsft_0-1729232728101.png

vzhangtinmsft_1-1729232753990.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, @Cyruslcc 

 

You can try the following methods.

Rank = 
RANKX(ALLEXCEPT('Table','Table'[Market],'Table'[Year]),CALCULATE(SUM('Table'[Sales])),,DESC)

vzhangtinmsft_0-1729232728101.png

vzhangtinmsft_1-1729232753990.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

Kedar_Pande
Super User
Super User

@Cyruslcc 

Rank = 
RANKX(
FILTER(
ALL('Table'[Store]),
'Table'[Market] = SELECTEDVALUE('Table'[Market]) &&
'Table'[Year] = SELECTEDVALUE('Table'[Year])
),
[Sales],
,
DESC
)

Ensure to test this setup to confirm it meets your expectations before finalizing your report.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1729135966861.png

 

 

Jihwan_Kim_0-1729135933163.png

 

 

Rank: =
IF (
    NOT ISBLANK ( [Sales:] ),
    RANKX (
        CALCULATETABLE (
            SUMMARIZE (
                sales_fact,
                market_dim[market],
                period_dim[year],
                store_dim[store]
            ),
            ALLSELECTED ( market_dim[market] ),
            ALLSELECTED ( period_dim[year] ),
            REMOVEFILTERS ( store_dim[store] )
        ),
        [Sales:],
        ,
        DESC
    )
)

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.