I work for a retailer and made a rolling 12 week sales average the brute force way. More specifically, I made 12 measures to calculate the average for my 12 weeks individually. Then a 13th measure to average my 12 weeks. That said, if a store has been open less than 12 weeks the average is lower than it should be.
How do you think I should work around this? My formulas are below.
Weekly Average
RollingAvg2 = calculate(sum('Transaction_Data'[TotalSales]),filter(all('Dates'),Dates[Week Rank]=MAX('Dates'[Week Rank])-1))
Aggregate Average
Rolling 12 Weeks = ('Rolling Measures'[RollingAvg1]+'Rolling Measures'[RollingAvg2]+'Rolling Measures'[RollingAvg3]+'Rolling Measures'[RollingAvg4]+'Rolling Measures'[RollingAvg5]+'Rolling Measures'[RollingAvg6]+'Rolling Measures'[RollingAvg7]+'Rolling Measures'[RollingAvg8]+'Rolling Measures'[RollingAvg9]+'Rolling Measures'[RollingAvg10]+'Rolling Measures'[RollingAvg11]+'Rolling Measures'[RollingAvg12])/12