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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EmiliaB_123
Helper II
Helper II

Get measure excluded from slicer in table

HI everyone,

 

I am creating an overview where I display through a DAX measure the quantity of the current year but also the quantitay of the previous years. The problem is that I also have a slicer toch choose the months of the current year in the report. Through this slicer the values of the previous year disappear of course. Is there a way to exclude in these dax measures the consideration of the slicer?

 

Thanks.

 

EmiliaB_123_0-1646327899161.png

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Yes. You need to remove the value from the slicer using ALL.

In your case:

 

Quantity 2019 =
CALCULATE (
    [Total Quantity],
    FILTER ( ALL ( Dim_Date ), Dim_Date[YEAR] = 2019 )
)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

Is the slicer from the Dim_Date table?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






No it´s not 🙂 Okay I think I got you. Thank you!

PaulDBrown
Community Champion
Community Champion

Yes. You need to remove the value from the slicer using ALL.

In your case:

 

Quantity 2019 =
CALCULATE (
    [Total Quantity],
    FILTER ( ALL ( Dim_Date ), Dim_Date[YEAR] = 2019 )
)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown ,

thanks for the quick replies. But this is unfortunately not working either:

EmiliaB_123_0-1646332526654.png

 

EmiliaB_123
Helper II
Helper II

Hi @PaulDBrown ,

EmiliaB_123_0-1646331138709.png

My current formula looks like this - does the one you showed before have a different impact?

Thanks.

PaulDBrown
Community Champion
Community Champion

If you need tha value for the whole year, use something along the lines of:

 

Value 2919 =
CALCULATE ( [Sum Value], FILTER ( ALL ( 'Table' ), 'Table'[Year] = 2019 ) )

 

If you want the value of 2019, but for the same month as is selected:

 

Value Same Period 2019 =
CALCULATE (
    [Sum Value],
    FILTER (
        ALL ( 'Table'[YearMonth] ),
        'Table'[YearMonth]
            = 201900 + SELECTEDVALUE ( 'Table'[Month] )
    )
)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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