Forum Discussion
GraemeSMiller
9 years agoFrequent Visitor
Event Data - Only Include Total Seconds That Fall Within Selected Period
New to Power BI and trying to learn - building a proof of concept about event data. I have events with various data - each event has a start date/time and an end date/timeand we calculate the tot...
- 9 years ago
It is possible the general idea is use a date table to slice on. Then have calculated measure
Filtered Duration = CALCULATE ( SUMX ( Event, DATEDIFF ( MAX ( MIN ( 'Date'[Date] ), Event[StartDateTime] ), MIN ( MAX ( 'Date'[Date] ), Event[EndDateTime] ), SECOND ) ), FILTER ( 'Event', 'Event'[StartDateTime] <= MAX ( 'Date'[Date] ) && 'Event'[EndDateTime] >= MIN ( 'Date'[Date] ) ) )
GraemeSMiller
9 years agoFrequent Visitor
It is possible the general idea is use a date table to slice on. Then have calculated measure
Filtered Duration =
CALCULATE (
SUMX (
Event,
DATEDIFF (
MAX ( MIN ( 'Date'[Date] ), Event[StartDateTime] ),
MIN ( MAX ( 'Date'[Date] ), Event[EndDateTime] ),
SECOND
)
),
FILTER (
'Event',
'Event'[StartDateTime] <= MAX ( 'Date'[Date] )
&& 'Event'[EndDateTime] >= MIN ( 'Date'[Date] )
)
)