Forum Discussion
Calculate unique viewership duration
mahoneypat how do i ensure i dont include the overlap in duration?
I thought you wanted to make sure overlapping views were included not excluded. Here is a different measure that will calculate the overall duration watched for each customer and video combination. Note this works with your example data, but if you have a customer that watched the first 10 sec and last 10 sec of a video, it would calculate the whole video duration. A more complex expression would be needed to avoid that. I didn't have time to do that now, but may later. Perhaps the below approach will be enough, or get you started.
NewMeasure =
SUMX (
SUMMARIZE ( Table, Table[Customer ID], Table[Video Name] ),
CALCULATE ( MAX ( Table[Stop Index] ) - MIN ( Table[Start Index] ) )
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat