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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Avoid measure from ignoring slicer using ALL()

Hi. I am trying to display both the current and previous year's sales with a year slicer like so:

 

refits.png

 

I am able to dynamically change the year perperly. Though, I want to be able to select the stores status was well ( 'Stores'[Status] ) and my measure for the previous year wont allow this since I am using an ALL() in the filter epxression. Below are both my measures:

 

TEST, YTD = SUM ( Sales[Sales] )
 
TEST, YTD LY = CALCULATE( [TEST, YTD], DATEADD(Sales[Date], -1, YEAR), ALL(Sales) )
 
I have two tables: 'Sales', with a [Sales] and [Dates] column, and 'Stores', with the [Status] column. There is a one to many connection from 'Stores' to 'Sales'. 
 
Is there a work around? Is it possible to even have the measures working with the status slicer? Thanks in advance!
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Hi, @Anonymous , you might want to specify column(s) in ALL() function to remove filter(s) on the assigned columns. I think this might do the trick.

TEST, YTD LY =
CALCULATE (
    [TEST, YTD],
    DATEADD ( Sales[Date], -1, YEAR ),
    ALL ( Sales[Date] )
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Hi, @Anonymous , you might want to specify column(s) in ALL() function to remove filter(s) on the assigned columns. I think this might do the trick.

TEST, YTD LY =
CALCULATE (
    [TEST, YTD],
    DATEADD ( Sales[Date], -1, YEAR ),
    ALL ( Sales[Date] )
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks so much! It now works as attended.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.