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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.