I have been struggling for a while to make a measure that would give me a result as shown in the picture below.
Basically, if there is an event then calculate the average for 'selected what-if value' number of days for the event's first date (yellow) and for the next days give the same values (orange). Events should be excluded from average calculation, every Product-Client should be calculated separately (event names may repeat).
The last formula I was at is below. Unfortunately, it gave the wrong average calculation,
The Dynamic Avg works well as long as Client and Product are both listed in the table. However, if I remove Product column and the Product data is aggregated (e.g. there are several products with Promo1 in the same period), then the averages are not aggregated and the value for Product1 is again shown. Is there a workaround for this?