Forum Discussion

James__'s avatar
James__
Icon for Helper I rankHelper I
3 years ago
Solved

Rolling average same period last year

Hi,

 

I have a rolling average measure which works as it should: 

@rolling_avg_sales_per_day = AVERAGEX(FILTER(ALLSELECTED('Calendar'),'Calendar'[Date]<=MAX('Calendar'[Date])),[@@@product_sales])
 

 

 
I then try and look for the same rolling average for the same period last year, but not getting the desired result. I have tried 2 measures without success:
1. 
@rolling_avg_sales_per_day_SPLY = CALCULATE([@rolling_avg_sales_per_day],SAMEPERIODLASTYEAR('Calendar'[Date]))
2. 
@rolling_avg_sales_per_day_SPLY = CALCULATE([@rolling_avg_sales_per_day],DATEADD('Calendar'[Date],-1,YEAR))
 
instead i am getting this:
 

 

 

Can anyone help with the correct measure, please?

 

Thanks

James 

1 Reply