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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
andersrisann
Frequent Visitor

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
v-binbinyu-msft
Community Support
Community Support

Hi @andersrisann ,

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors