Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi together,
I got an issue with this Dax-Formula. The part with the variable and SelectedValue is not working. I am selecting the value in a visual table. The format of the Selected Value is dd/mm/yyyy hh:mm:ss.
Can anybody help me with this issue?
InDateTimeRange =
var _rangeStart= SELECTEDVALUE(Data[TimestampFrom])
var _rangeEnd= SELECTEDVALUE(Data[TimestampTo])
return
IF(
SELECTEDVALUE(Data[TimestampFrom]) >= _rangeStart
&& SELECTEDVALUE(Data[TimestampTo]) <= _rangeEnd
&& SELECTEDVALUE(Data[TimestampTo]) <>BLANK()
, 1, 0)
Solved! Go to Solution.
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.
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)
Hi, this is unfortunately not working. The Dax Formula can not find the column in the Data, because it is not aggregated.
Hi Did you find solution for the above issue? I am facing same problem.