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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
gaznez
Resolver I
Resolver I

Dynamic ranking

Hi all,

 

I have a matrix with dates as the rows, branch as the columns, and then sales volumes and a rank as the values.

The measure for my rank is:  

RankVolOM = RANKX(ALL(Dates[Date]), [TotalVol])
My result is:
gaznez_0-1718375132658.png

 

I have a Date slicer - and if I select 2023, the data retains it's original rank (presumably because I used ALL(Dates[Date]).  How can I get the ranking to update so rank 1 becomes the highest value in the dates I've selected?  (In the example above - Jun 23 would become Rank 1, August 23 Rank 2 etc.)

Thanks for any help!!

1 ACCEPTED SOLUTION
gaznez
Resolver I
Resolver I

UPDATE: I managed to figure this out if anyone is interested (with the help of ChatGPT)
The following formula works (I'm not sure why/how)

RankVolOM = VAR AllSelectedDates = CALCULATETABLE(
    VALUES(Dates[Date]),
    ALLSELECTED(Dates)
)
RETURN
RANKX(
    AllSelectedDates,
    [TotalVolOM],
    ,
    DESC,
    Dense)

View solution in original post

3 REPLIES 3
gaznez
Resolver I
Resolver I

UPDATE: I managed to figure this out if anyone is interested (with the help of ChatGPT)
The following formula works (I'm not sure why/how)

RankVolOM = VAR AllSelectedDates = CALCULATETABLE(
    VALUES(Dates[Date]),
    ALLSELECTED(Dates)
)
RETURN
RANKX(
    AllSelectedDates,
    [TotalVolOM],
    ,
    DESC,
    Dense)

Try to create a normal measure without rankx, and add a filter on the visual whit that requirement , like that :

PabloVallejo12_0-1718375764297.png

 

Hi @PabloVallejo12 ,  thanks for the suggestion.  However - I don't want to show the top N values.  I may want to select 2 years and see the ranking for all volumes in that date range.

Also when I click on filters - my only options are things like 'is less than', 'is greater than', 'is not' etc.  There are no options for 'Top N'.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.