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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
arcejames
Frequent Visitor

Grand Total of Measures did not match with SUM of row values

Hello,

I've created a measure that multiplies TotEndingInventory (wish is a meassure) by TotStCost ( which is a measure as well)  But, when I put that measure in a table, the grand total is performing its original function (that is TotEndingInventory * TotStandarCost instead of summarizing the individuals row values.
According with the screenshot below, the total of TotEndingInventoryVal column is $211 437, which is the result of TotEndingIventory * TotStCost, instead of $72 945, which is the SUM of the row values in this column...
Can anybody help me please?
Tks in advance.table.png

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this

=IF(HASONEVALUE([SAPMaterial]),[TotEndingInvValue],SUMX(SUMMARIZE(VALUES([SAPMaterial]),[SAPMaterial],"Total",[TotEndingInvValue]),[Total]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Try this

=IF(HASONEVALUE([SAPMaterial]),[TotEndingInvValue],SUMX(SUMMARIZE(VALUES([SAPMaterial]),[SAPMaterial],"Total",[TotEndingInvValue]),[Total]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

It it working. Thank you so much

jdbuchanan71
Super User
Super User

Hello @arcejames 

Are the amounts that are feeding into your two measures [TotEndingInventory] and [TotStCost] in the same table as the SAPMaterial field? 
I will assume this is the case and the table is called Sales.

You will want to use an iterator over your table to do the calc, something like

TotEndingInvVal2 = SUMX ( Sales, Sales[EndingInventory] * Sales[StCost])

Please note that the EndingInventory and StCost in my measure are the columns in the sales table, the ones you sum in your existing measure.

If I have missed the mark, please share a sample of your model so we can help further.

MitchM
Resolver II
Resolver II

Can you please share your measures and/or a mock dataset? 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.