It gives me the rolling average for weeks where there are sales but does not include weeks without sales. I want the rolling average of two weeks including the weeks where there were no sales.
For example, if I have the following table:
Week
Sales
Rolling Average of Sales (What I am trying to achieve)
I think it would work if your data source had '0' for week4 . But if its blank and the combination comes from a join from a fixed week dimension, then it could be being treated as missing or null...in which case null+ something else is always null (and being rendered as zero).
If you replace sum(Sales) with a check for null (and assign 0) does it help ?