How can I calculate the daily percentage of time an event occupied?

Let’s assume I have a list of events and the their respective duration. I want to plot, per day, the percentage of time they have occupied and want to use as a KPI, for N days (controlled with a slider) how much of the total time available they have occupied. How can I achieve this? I believe I have to create a calculated field but I don’t know how to get the total time here, specially when the number of days is varying with the slider

Thank you!

Hi, you can create a calculation for everyday total duration by duration_date=sum(duration, [date]) (this is a new feature we just launched called Level Aware Calculations). You can further aggregate the sum for duration across N days.
For the percentage of duration for each events, you can define another calculation such as Percentage=duration_event/duration_date.