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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

RANKX and muliple slicers

Hi,

I have a set of stores with revenue per week/year. Each store has a ID, belongs to a revenue group and price class. I want to rank the stores by the revenue growth compared to a time period previous year.

 

 

 

andersrisann_0-1683710246101.png        andersrisann_1-1683710255360.png

 

I have created a measure that calculates the %-revenue growth as follows (and it's working), but have some issues with the ranking.

I have tried using this measure without any luck:

 
Rank rev_growth_ALL = 
        RANKX(
        FILTER(ALL(Store_ID),
        dStores[Revenue Group]=SELECTEDVALUE(dStores[Revenue Group])&&
        dStores[Price class]=SELECTEDVALUE(dStores[Price class])),
        [revenue_growth]))

 

The issue is that I have three slicers for the Store ID, Revenue group and Price class respectivly. If I filter on a specific store without selecting any of the other slicers, I want to return the rank of the selected store relative to all stores within the same revenue group and price class. This is manged by my above DAX code.

 

HOWEVER, if I select a revenue group without selecting any stores, my stores are ranked per price class, while I want it to show the rank for all stores within that revenue group disregarding the price classes. 

 

Thus, it's the different combinations of my slicers which creates some issues with the ranking. 

 

Any idea on how to solve this?

 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting and desensitized example data.

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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