Forum Discussion
brunborg
7 years agoFrequent Visitor
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...
- 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
TeigeGao
7 years agoSolution Sage
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