Forum Discussion
How to calculate Forecast accuracy
Hi,
I've been trying to get my head around how to calculate a forecast accuracy. Here is how I usually set up a simply formula in excel:
First I calculate the absolute variance between sales and forecast. I do this for each individual "Material" (product).
absolute variance = ABS(Actual sales - forecast)
Then I summerize the total ABS variance and the total forecast to get the Forecast Accuracy:
Forecast Accuracy = 1 - ( Total ABS variance / Total Forecast )
(at the top you can find a small sample)
If anyone has an idea it would be greatly appreciated. This is getting on my nerves :)
15 Replies
- Greg_Deckler
Community Champion
Pretty much the same. I created data with your firt 3 columns. Then a measure like this:
Asolute Variance = ABS(SUM(ForecastAccuracy[Sold])-SUM(ForecastAccuracy[Forecast]))
Then I creaed another measure like this:
Forecast Accuracy = 1 - ( [Asolute Variance] / SUM([Forecast]) )
Put the first 3 columns and the first measure into a table.
Put the second measure into a card visualization. Your Forecast Accuracy will work in your table as well for the forecast accuracy of each material.
- HammarbergFrequent Visitor
Hi and thanks for the quick reply!
I tried this with the sample and I get the Forecast Bias (95%) instead of Accuracy (90%). At Material level it would be correct, but it cannot handle the fact that some have sold above forecast and others below.
So in short I think that the formula you provided does not evaluate each row, it summerizes them and then says to turnes it to "Absolute". Some how it needs to evaluate eatch Material first and then add every individual variance together.
- Sean
Community Champion
convert the abs variance to a column
ABS Variance COLUMN = ABS ( 'Table'[Forecast] - 'Table'[Sold] ) Bias = DIVIDE ( SUM('Table'[Sold]), SUM('Table'[Forecast]), 0 ) Accuracy = 1 - (SUM('Table'[ABS Variance COLUMN]) / SUM('Table'[Forecast] ) )
- Brutus82Regular Visitor
As I see this problem, it's basically creating a Excel SUMIF() within DAX. My example is slightly different but hopefully illustrates the point. The key was creating a 'staticdate' dynamic value which every summed row was filtered on, like so:
Sum_error = VAR staticdate = nepool[date] return abs(sumx(FILTER(NEPOOL, NEPOOL[Date] = staticdate),NEPOOL[STF_Error])) / countrows(FILTER(NEPOOL, NEPOOL[Date] = staticdate))
Nepool is my dataset name. STF_Error is the error in the forecast. I divided it by the number of rows so the aggregation worked correctly.
James