Using Filters and Partitions on WindowAvg

I’m trying to display a Moving Avg metric as a line chart grouped by another dimension. I’ve added the Group By field as a partition field in the windowAvg calculation, but the resulting average for the time window doesn’t match up with the actual values. It seems that this may be bc the start index and end index are calculated before the group partition.

Is this the right root cause of my issue? If not, any ideas on how to accurately calculate a windowAvg for each group in a line chart?

If it is the right root cause, does anyone know what calculation level (PRE_AGG, PRE_FILTER, or POST_AGG_FILTER) the windowAvg function works at? And is there a way to indicate the calculation level for this function?

Here’s the current field calculation:
windowAvg({Field1},[{date} ASC],3,0,[group by Field 2])

Hi @schirrj,

Can you please share sample or screenshots of the above issue if possible? The start index and end index is based on the rows of data as explained in the windowAvg function. Below is a sample calculation and the screenshot. Let me know if this is what you were trying to achieve.

windowAvg(sum(Sales), [{Order Date} ASC], 3, 0,[Segment])