Forum Discussion
DAX Variable + Selected Value with Date and Time
- Anonymous4 years ago
Hi Anonymous ,
If you want to set a dynamic flag for rows based on the date period selected in slicer, I'd suggest you firstly add a new Date table:
Date Slicer = CALENDAR(MIN('Data'[TimestampFrom]),MAX('Data'[TimestampTo])+1 )Then modify your measure like:
InDateTimeRange = var _rangeStart= MIN('Date Slicer'[Date]) var _rangeEnd= MAX('Date Slicer'[Date]) return IF(MAX(Data[TimestampFrom]) >= _rangeStart&& MAX(Data[TimestampTo]) <= _rangeEnd&& MAX(Data[TimestampTo]) <>BLANK(), 1, 0)Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Can you try removing the selectedvalue from the if statement and then check if it works ok?
InDateTimeRange =
var _rangeStart= SELECTEDVALUE(Data[TimestampFrom])
var _rangeEnd= SELECTEDVALUE(Data[TimestampTo])
return
IF(
Data[TimestampFrom] >= _rangeStart
&& Data[TimestampTo] <= _rangeEnd
&& Data[TimestampTo] <>BLANK()
, 1, 0)
- Anonymous4 years agoNot applicable
Hi, this is unfortunately not working. The Dax Formula can not find the column in the Data, because it is not aggregated.
- tatees2 years agoFrequent Visitor
Hi Did you find solution for the above issue? I am facing same problem.