Forum Discussion

fourmj's avatar
fourmj
Frequent Visitor
4 years ago
Solved

Calculate Mean Absolute Percent Error (MAPE) when all values are in singular column?

Does anyone know how to calculate MAPE if all the data values are in the same column?  This is the MAPE Formula for reference: (1/n) * Σ(|actual – forecast| / |actual|) * 100 Here's what my d...
  • fourmj's avatar
    4 years ago

    Edit: So, I found out a way to solve this problem after reading https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/td-p/547907.

     

    First, I modified [7. Backtesting Mape] to solely return MapeElement. 

     

    Then I created a measure:

     

    7. Backtesting MAPE Summarize =
    VAR _table =
    SUMMARIZE(
         '7_Temp',
         '7_Temp'[Date]
         "_Value", [7. Backtesting MAPE]
    )
    
    RETURN
    
    IF(
        HASONEVALUE('7_Temp'[Date]),
       [7. Backtesting MAPE],
        AVERAGEX(_table, [_Value])
        )
    )

     

     

    This measure is returning the correct MAPE value.