3

I have a date slicer that is controlled by the user. I am trying to use the users min/max date selection as a indicator. I have created two measures - one for the min value and another measure for the max value. Please see DAX code for one below:

NewMin = CALCULATE(FIRSTDATE('Master Query'[RegisterDate]),ALLSELECTED('Master Query'))

Now, on the Master Query Table there is a column that holds date values in the format of dd/mm/yyyy 00:00:00...I am adding another column and using a if statement to get a 0/1 output (i.e. checking if the date column is between the min and max date slicer selection) but it is not working. See DAX Below:

RangeCheck = IF('Master Query'[RegisterDate] >= 'Master Query'[NewMin] && 'Master Query'[RegisterDate] <= 'Master Query'[NewMax],1,0)

This does not work and I am unsure as to why. It seems its not recognising the dates or cant decipher if date is between the two min and max boundries.

Daisy
  • 121
  • 1
  • 9

1 Answers1

1

A calculated column cannot read in dynamic filters from slicers. Calculated columns are only computed once per time the model is refreshed, not in response to interaction slicers or the filter pane.

In contrast, measures do work for dynamic calculations (though not when you try to use them within a calculated column).

Alexis Olson
  • 38,724
  • 7
  • 42
  • 64