2 Replies Latest reply on Nov 21, 2018 7:00 PM by Paul Wachtler

# Moving Average

Hi,

Is there an easy way to calculate 6 weeks moving average without windows function ? Also, if the first few weeks are null or zeros then I need Tableau to calculate the average starting at a number that is >0 for example I have sales: 1,4,4,1,2,8 then my moving average  would be sum of those six numbers divided by 6 but what when  I have 0,0,0,1,2,8, I don't want to average 6 records as the first zeros indicates that this is a new product that started selling three months ago so dividing by 6, it will lower the average sales. Any ideas?

• ###### 1. Re: Moving Average

Hi Magdalena,

Re: Distinct active users in prior 90 days for a given week

As for your second question, you'd have to distinguish

between the zero sales (the evidence of absence of sales)

and the null sales (the absence of evidence of sales).

Hope it could help a bit.

Yours,

Yuri

• ###### 2. Re: Moving Average

Hi Magdalena,

May I ask why you don't want to use a window calculation for figuring out the moving average?  That's the most direct way of doing it.  I'm not sure how to do it otherwise.

Best,

Paul