Forum Discussion

brunborg's avatar
brunborg
Frequent Visitor
7 years ago
Solved

Filter on time interval

I am struggling with the problem of creating a filter / slicer that returns events that either starts, ends, or spans a time interval. Each event has a defined start time and end time, and I also hav...
  • TeigeGao's avatar
    7 years ago

    Hi brunborg ,

    Firstly, remove the relationship between Event table and data table, create relationship between data table and month table.

    The create a measure like below:

    Measure =
    IF (
        MIN ( Events[Start Date] ) IN VALUES ( 'Date'[Date] )
            || MIN ( Events[End Date] ) IN VALUES ( 'Date'[Date] )
            || (
                MIN ( Events[Start Date] ) < MIN ( 'Date'[Date] )
                    && MIN ( Events[End Date] ) > MAX ( 'Date'[Date] )
            ),
        1,
        0
    )

    Then drag this measure to FILTERS, set it like below:

    The result will like below:

    Best Regards,

    Teige