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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Sum Of Measure

Hello Everyone!

 

I am trying to calcule KPI wich is called WMAPE, my data is like the picture bellow, 

img.PNG

I have the following formulas: 

1. Percent Error =
ABS (
    DIVIDE (
        SUM ( 'Table1'[Forecast_final] )
            SUM ( 'Table1'[Sales] );
        SUM ( 'Table1'[Sales] )
    )
)

2. Actual =  SUM ( 'Table1'[Sales] )
3. Percent Error * Actual = [Percent Error]*[Actual]
 
Then i need to divide the sum of the measure [Percent Error * Actual]/[Actual], but my problem is that the value in the total is not the sum of the measure, but is the calculated value of all the data, I need this measure beacuse i need to filter the data acording to the SKU and the Warehouse. 
I was trying with this formula but it did not worked:
Suma Correcta =
SUMX (
SUMMARIZE (
'Table1';
'Table1'[PeriodDate];
'Table1'[warehouse];
'Table1'[sku];
'Table1'[Sales];
'Table1'[Forecast_final];
"temp"; (ABS(DIVIDE(SUM('Table1'[Forecast_final])-SUM('Table1'[Sales]);SUM('Table1'[Sales]))))*SUM('Table1'[Sales])
);
IF ( ISERROR ( [temp] ); 0; [temp] ))

Please i need some help!
 
Kind regards 
CY
2 ACCEPTED SOLUTIONS

@Anonymous change your measure like this and test

 

 

change your measure like this and test
 
Percent Error * Actual = SUMX( SUMMARIZE( Data, Data[SKU], Data[Warehouse]), [Percent Error]*[Actual] )

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Anonymous
Not applicable

@Anonymous 

If you want to calculate the sum of the measure just using SUMX.
Percent Error * Actual = SUMX(Table, [Percent Error]*[Actual])

You should always use X function(sumx, averagex,etc) when calculating with measures, the value of each row then can be saved and calculated.


Best,
Paul

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Anonymous 

If you want to calculate the sum of the measure just using SUMX.
Percent Error * Actual = SUMX(Table, [Percent Error]*[Actual])

You should always use X function(sumx, averagex,etc) when calculating with measures, the value of each row then can be saved and calculated.


Best,
Paul

parry2k
Super User
Super User

@Anonymous not sure where you want the final calculation to be, at the total? Based on the screenshot of dataset your provided, what you want output to be?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k  thaks for replying, the thing is the following: 

my data is divided into date, sku and warehouse, my two measures for obtaing the Abs Error and the Abs Error * Sales are working fine, i need that the total of the column be 64315, and my result is giving me this:

Capturad.PNG

I want to calculate the division of the sum (abs error * sales)/sum(sales), this is how looks like in excel 

Capturaswcds.PNG

@Anonymous change your measure like this and test

 

 

change your measure like this and test
 
Percent Error * Actual = SUMX( SUMMARIZE( Data, Data[SKU], Data[Warehouse]), [Percent Error]*[Actual] )

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.