Hey I am using the following formulas to predict sales. These formulas work how i expect however when i try to implement a cumulative function, it breaks down.
Prediction =
Var monthlyAverage = AVERAGEX(VALUES('Dates'[MonthnYear]), [Scenario Agreement Gross Margin])
Var averageTotal = SUMMARIZE('Dates', 'Dates'[MonthName], "Monthly Average", monthlyAverage)
Return
IF(HASONEVALUE('Dates'[MonthName]), monthlyAverage, SUMX(averageTotal, [Monthly Average]))
Production + Actuals = i
f(ISBLANK([sales this year]) || SELECTEDVALUE(Dates[MonthOfYear]) = MONTH(TODAY()), [Prediction], [sales this year)])
Cummulative Prediction Scenario =
CALCULATE([Prediction + Actuals], FILTER(ALLSELECTED(Dates), Dates[Date] <= MAX(Dates[Date])))
These are the formulas currently being used. The output can be seen in the photo
Sam I think that the DAX formula for the solution above could be simplified by using the cumulative total pattern and slightly modifying it. I was able to recreate your solution using the cumulative total pattern by modifying the date filter to use month number instead of date: