Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help with AVERAGEX

Hello, I set up a measurement that calculates the KPI MAPE, but the totalizer does not present the correct result.

Measure breakdown:

MAPE:=IF(HASONEVALUE(base[Cod_SAP]); iferror(if([Forecast] <=0; 1;abs([Forecast] - [Measured]) / [Measured]); 1); AVERAGEX(base;iferror(if([Forecast] <=0; 1;abs([Forecast] - [Measured]) / [Measured]); 1))) 

And the detail of the other measures:

Forecast:=CALCULATE(sum([Unidades]);base[Atributo] = "Forecast")
Measured:=CALCULATE(sum([Unidades]);base[Atributo] = "Measured") 


The results: https://i.imgur.com/laRfRW5.png

The averages Forecast and Measured are in the same column, but are filtered.

At that moment, the MAPE measure works when I look at an item, but in total it does not present the correct value. In a search, I saw that I could use AVEGAREX, but it didn't work. Can you help me? Thanks!

5 REPLIES 5
AlexisOlson
Super User
Super User

Can you explain how averaging the item-level values is "more correct" than doing (Total Forcast - Total Measured)/Total Measured, (which is an average weighted by [Measured] rather than giving the same weight to each item)?

Anonymous
Not applicable

I also had this doubt when I analyzed the calculation made in an excel spreadsheet. In summary, it is a methodology that was adopted here, where the total view is the sum of the averages.

It's certainly possible to average the averages but I wouldn't recommend it unless you have a specific reason to do so.

Anonymous
Not applicable

I understand your point, but it is a methodology that the company uses. Anyway, thank you for your help.

For averaging over Items, the pattern looks like this:

Avg Item MAPE = AVERAGEX ( VALUES ( base[Item] ), [MAPE] )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors