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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Robin96
Helper II
Helper II

DAX calculation with slicer values

Hey guys, i have a small questions regarding a DAX measure.

My goal is to have my last measure "Above or below"  in the visual to show "Equal or below" on the first selected week, and above on the rest. like i have screenshotted under. But when i select a week higher then 1, its not working.

Robin96_0-1708673793328.png


This is my measure right now:
IF_TEST = IF(MIN('Dimension Date'[Week Number])>CALCULATE(MIN('Dimension Date'[Week Number]), REMOVEFILTERS('Dimension Date'[Week Number])),"Above","Equal or below")

It do seem that my REMOVEFILTERS removes the slicers i have selected and gives the lowest output. But i want my slicers to work.

Any suggestions?

1 ACCEPTED SOLUTION
jolind1996
Resolver II
Resolver II

It seems like you’re trying to retain the slicer selection while evaluating the minimum week number. Consider using the ALLSELECTED function instead of REMOVEFILTERS to respect the slicer’s context. Modify your DAX measure as follows: IF_TEST = IF(MIN('Dimension Date'[Week Number]) > CALCULATE(MIN('Dimension Date'[Week Number]), ALLSELECTED('Dimension Date'[Week Number])), "Above", "Equal or below"). This should give you the desired output based on your slicer selection. Remember, ALLSELECTED respects the filters applied by slicers, unlike REMOVEFILTERS which ignores all filters.

 

Best regards,

Johannes

View solution in original post

2 REPLIES 2
jolind1996
Resolver II
Resolver II

It seems like you’re trying to retain the slicer selection while evaluating the minimum week number. Consider using the ALLSELECTED function instead of REMOVEFILTERS to respect the slicer’s context. Modify your DAX measure as follows: IF_TEST = IF(MIN('Dimension Date'[Week Number]) > CALCULATE(MIN('Dimension Date'[Week Number]), ALLSELECTED('Dimension Date'[Week Number])), "Above", "Equal or below"). This should give you the desired output based on your slicer selection. Remember, ALLSELECTED respects the filters applied by slicers, unlike REMOVEFILTERS which ignores all filters.

 

Best regards,

Johannes

Hey Johannes,

This did work perfectly! Thank you so much for the help!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.