cancel
Showing results for 
Search instead for 
Did you mean: 

how to calculate 16 days moving average in WEBI

Former Member
0 Kudos

Hi all

I am working on a line chart, on x-axis i got 4 months and on Y-axis i got sales qty.

I need to show 16 days moving average on this 4 months where the begging of the chart is caluclated 16 days before of it and shouldn't be shown in the chart.

I know formula like [measure]Previous[Measure]previous(previous[measure])) but this is for 3 days moving average, any inputs please for finding the previos16 days moving average?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Short version is this:

=(RunningSum([Sales Qty]) - RunningSum(Previous([Sales Qty]; 16))) / 16

Add that as a column in a block with your dates and it'll give you a moving average of 16 days.

So what it does is calculate the running total for your sales quantity. But because you only want the last 16 days, if will subtract all numbers before 16 days ago (which is the running sum of the previous statement with an offset of 16). So that gives you a running sum for the last 16 days, and then divides it by 16, giving you the average.

DG.

Former Member
0 Kudos

This helped me a lot, and thanks a ton for such a nice reply

Answers (0)