Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Filter table if dates range is overlapping other dates range in another table

Greetings.   I have a Table 'C' what contains two columns 'colStart' and 'colEnd'. It's a Date Range.   What I need is a slider that allows to select a dates range and filter 'C' table show...
  • v-juanli-msft's avatar
    7 years ago

    Hi Anonymous

    It is impossible to create a new table physically (click on "New Table") and make it change with slicer.

    You could use a table visual and make the table visual change with the slicer.

     

    1.Create a calendar date table

    calendar = CALENDAR(MIN(Table1[colStart]),MAX(Table1[colEnd]))

    Edit relationship with "calendar" table and data table based on 'calendar' [Date] to [colStart] and 'calendar' [Date] to [colEnd]

     

    2. create measures

    create measures in the 'calendar' table

    min = MIN('calendar'[Date])
    
    max = MAX('calendar'[Date])

    create measures in the data table

    flag = IF(MAX(Table1[colStart])<=[max]&&MAX(Table1[colEnd])>=[min],1,0)

    3. add 'calendar' [Date] to the slicer, then add 'Table1'[flag] to the Visual Level filter and select "show items when value is 1"

     

     

    Best regards

    Maggie