Forum Discussion
wjlee
1 year agoFrequent Visitor
Checking if selected date slicer is between 2 date columns
Hi all, I am facing difficulty figuring out how to check if a selected value of a date slicer is in between 2 date columns. Use Case - When the user selects a date in the date slicer, there shoul...
dharmendars007
Memorable Member
1 year agoHello wjlee ,
You can try the below corrected bersion of DAX..
DateCheck =
VAR SelectedDate = SELECTEDVALUE('Date'[Date]) -- Get the selected date from the slicer
RETURN
IF (ISBLANK(SelectedDate),
0, -- No date is selected, return 0
IF (SUMX(
FILTER(MainCalendar,
SelectedDate >= MainCalendar[StartDate] &&
SelectedDate <= MainCalendar[EndDate]),1) > 0,
1, -- Date falls within the range
0 -- Date does not fall within the range))
Outer IF Conditions>> Returns 1 if at least one match is found, Returns 0 otherwise.
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S