Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Moving average trend calculation.

Hi all...I need to show a trend of current month sales vs previous 3 month moving average sales excluding the current month for a selected year in line chart irrespective of user selection. For example, if current month sales for the month of July in the year 2014 is 2000, average sales of previous 3 months(April,May,June) is to be shown against July and likewise for all the months. 

Can anybody please help??

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

If that the case and 3 last month are taken into account so month 3 should be 2500 not 1667,

Please see below

The Expression is

RangeAvg(Above(sum(Sales),1,3))

View solution in original post

7 Replies
robert_mika
Master III
Master III

Could you post sample of your data?

Anonymous
Not applicable
Author

  This is the sample data. Please note that the month for which the avg sales is being calculated, is excluded and only its previous 3 month sales is taken into consideration.

                                                                                                      

Year

MonthSalesPrevious 3 month Avg Sales
2014120000
2014230002000
2014310001667
2014425002000
2014540002167
2014630002500
2014710003167
2014820002667
2014935002000
20141040002167
20141115003167
20141220003000
robert_mika
Master III
Master III

If that the case and 3 last month are taken into account so month 3 should be 2500 not 1667,

Please see below

The Expression is

RangeAvg(Above(sum(Sales),1,3))

MK_QSL
MVP
MVP

Excellent and Useful blog created by Gysbert...

Calculating rolling n-period totals, averages or other aggregations

Anonymous
Not applicable
Author

Thanks Robert, It's working absolutely fine.

Anonymous
Not applicable
Author

Thanks Manish, that was helpful.

robert_mika
Master III
Master III

You are welcome.