Forum Discussion

misc981's avatar
misc981
Frequent Visitor
1 year ago
Solved

Filter table based on selection in another table

I have a SP datasource describing user leave requests with columns 'Leave Type, 'To' and 'From' columns. The exact dates for each and every day is not available, only the 'To' and 'From' columns. Our...
  • Shahid12523's avatar
    1 year ago

    Don’t make 7 tables → create one Next7Days table with dates TODAY() → TODAY()+6.

     

    Use a measure like:

     

    IsOnLeave =
    VAR d = SELECTEDVALUE(Next7Days[Date])
    RETURN IF( MAX(Leaves[From]) <= d && MAX(Leaves[To]) >= d, 1, 0 )


    Filter the leave detail table with IsOnLeave = 1.

    Add slicer for Leave Type → both date + type filter will apply.

     

    Much cleaner than 7 visuals.