For each month of each year I do the following :
Budget January 2013 = Production January 2012
Budget January 2014 = (Production January 2012 + Production January 2013) / 2
Budget January 2015 = (Production January 2012 + Production January 2013 + Production January 2014) / 3
and I need the total to be the sum of the monthly averages i.e. :
average of January + average of Febuary + …
Production Budget =
VAR _min = 2012
VAR monthlyBudget= CALCULATE(AVERAGEX(‘Table’,[Production]]),FILTER(ALL(Dates),(Dates[Year]>=_min && Dates[Year]<MAX(Dates[Year])) && Dates[MonthName]=MAX(Dates[MonthName])))
RETURN
IF(HASONEVALUE(Dates[MonthName]),
monthlyBudget,
SUMX(VALUES(Dates[MonthName]),monthlyBudget)
)
The average for each month works fine, however the total I get is wrong and I don’t know what to change in the formula to fix it.
Can somebody help me ?
Thanks for your answer but this solution only works when there is only one year of historical, and in this case I have to take into account several years…
If it’s OK to you I would really like to recommend you one tip which may prove helpful to you that is always one should always go for the “Measure Branching” technique first and once that technique provides you the desired results then you can combine those formulas in the form of “Variables” and put it in one formula.
Because by following the “Measure Branching” one can analyze the results and the steps about where they went wrong or have faltered and if we directly go for “Variables” we may get lost and may also find it difficult to analyze where we went wrong.
I’ve learned this technique from Sam where he has always recommended to built - up or start with small measures so that we know what process we are following and whether that process will provide the fruitful results or not.
Hoping you will find this useful and helps you in your future analysis. Best of luck.