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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.

June 2025 community update carousel

Fabric Community Update - June 2025

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