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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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