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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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