Forum Discussion

vipett's avatar
vipett
Helper III
2 years ago

Weighted MAPE

I would like to calculate a weighted MAPE but first I can't get the total to work, and secondly no clue how to solve the weighted part.

 

Currently I have two measures, [Current Forecast] and [Actual]. The forecast comparison has three dimensions, Product Group, Country and Month.

This version of MAPE gives me a total line which is just based on the totals per column, but I want to capture acutal MAPE per line and then have the average per product group as the total:

MAPE = IF([Actual]=0,1,ABS(([Actual]-[Current forecast])/[Actual]))
 
In this version I tried with Hasonevalue, but still can't get it to work, same output as the above forumula:
MAPE2 =
VAR MapeElement =
IF([Actual]=0,1,ABS(([Actual]-[Current forecast])/[Actual]))
 
)
RETURN
IF(
    HASONEVALUE(FCTProductMap[Product Group]),
    MapeElement,
    AVERAGEX(FCTProductMap,
    MapeElement
    )
)

 

This is what my table looks like.

MAPE2 should be ~129% and if I have weighted MAPE2 based on Forecast (Acutal where forecast = 0 ), it should be 199%

 

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, 

    have you considerd that 1 is the same as 100%, so if you have an actual of 0, the value one would then be translated to 100%. The 12.28% for instance would be 0.1228.

    Hope this helps you!

    • vipett's avatar
      vipett
      Helper III

      Hi, Yes, if the actual = 0 while we have a forecast, or if the forecast is 0 and the acutal is larger than 0, then it it is a 100% error