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,
Thanks bhanu_gautam for Addressing the issue.
we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,
Vinay Pabbu
- Anonymous1 year agoNot applicable
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- Anonymous1 year agoNot applicable
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