Forum Discussion

Robin96's avatar
Robin96
Helper II
2 years ago
Solved

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...
  • jolind1996's avatar
    2 years ago

    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