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

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

Reply
zenbabasha33
Regular Visitor

DAX Rank Function is not working when I choose multiple dates from the filter

hi Team,
 
I have two filter Date and Region.  when i choose one date it works we and as expected but if I do multiple date from the filter it isnot working. This is the DAX i am using below.
Rank = RANKX(
    ALLSELECTED('Royalty'),
    'Royalty'[Adjusted Gross Revenue],
    ,
    DESC,
    Skip
)
 
any kind of help would be greatly appreciated.
Thanks 
1 ACCEPTED SOLUTION
Rakesh1705
Super User
Super User

Hi @zenbabasha33 
Source Data

Rakesh1705_0-1722692467398.png

Rank Function

Rakesh1705_1-1722692509083.png

Select any date from the slicer, the rank will adjust within itself

View solution in original post

5 REPLIES 5
Rakesh1705
Super User
Super User

Hi @zenbabasha33 
Source Data

Rakesh1705_0-1722692467398.png

Rank Function

Rakesh1705_1-1722692509083.png

Select any date from the slicer, the rank will adjust within itself

Thank you 

asadmd93
Advocate I
Advocate I

ALLSELECTED function gives you all the rows in a table, ignoring the current context filter, which might be causing the unexpected ranking result when multiple dates are selected. You can use the DAX formula below to respect the current filter context for the date.

 

Rank = 
RANKX(
    ALLSELECTED('Royalty'[Date], 'Royalty'[Region]), 
    'Royalty'[Adjusted Gross Revenue],
    ,
    DESC,
    Skip
)

 


Another approach is to use ALL on the date column specifically, rather than the entire table, which ensures that other filters like Region are still respected.

aduguid
Super User
Super User

Try this measure. If you want to rank across all selected dates without splitting by date, you can ignore the date filter in the ranking context.

Rank = 
RANKX(
    ALLSELECTED('Royalty'[Region]), 
    'Royalty'[Adjusted Gross Revenue],
    ,
    DESC,
    Skip
)

 

Thank you but I alreaddy  Tried this one

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.