MAD not calculating correctly when using a 6 month rolling average

peterr2006

New Member
Joined
Jan 2, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am trying to calculate the MAD between a 6 month rolling average (R6M) and the actual sales. I have used a formula to calculate a 6 month rolling average with a 3 month offset in a power pivot measure but when I go to calculate the MAD R6M it either gives me the actual sales or zero.

My data table has the columns month (in the format YYYMM), Actual Sales and the Date (being the 1st of the month).

My measures are as follows:
Actual:=sum([Sales])
Average Sales:=AVERAGEX(VALUES(Table1[Month]),[Actual])
R6M:=CALCULATE([Average Sales],filter(all('Table1'[Month]),'Table1'[Month]),DATESINPERIOD('Table1'[Date],DATEADD(PREVIOUSMONTH(LASTDATE('Table1'[Date])),-3,MONTH),-6,MONTH))
AD R6M:=abs([Actual]-[R6M])
MAD R6M:=SUMX('Table1',[AD R6M])

I have attached a screenshot of my pivot table results.
 

Attachments

  • Pivot Table.PNG
    Pivot Table.PNG
    29 KB · Views: 7

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,814
Messages
6,181,126
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top