Forum Discussion
Join DimDate to Fact where DateTime is inbetween StatusFrom and StatusTo
- 1 year ago
Maverikk Try using
DAX
IsDateBetweenStatus =
VAR SelectedDate = SELECTEDVALUE('Dim Date'[Date]) -- Get the selected date from the slicer or context
VAR DateTimeAtMidnight = SelectedDate + TIME(23, 59, 59) -- Combine the date with '23:59:59' time
RETURN
IF (
DateTimeAtMidnight >= 'Fact Device Status'[StatusFromDateTime] &&
DateTimeAtMidnight <= 'Fact Device Status'[StatusToDateTime],
1, -- Returns 1 if the selected date (with '23:59:59' time) is between StatusFrom and StatusTo
0 -- Returns 0 otherwise
)
Hi Maverikk,
May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.
Regards,
Vinay Pabbu
Hi Maverikk,
May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.
Regards,
Vinay Pabbu