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
Blevels
Frequent Visitor

DAX Calculate Column results in Wrong Table Total

Hi,

A Visualization Table Total value for a calculated measure is incorrect.

I have a table visualization that includes a list of inventory parts and the part attributes.

This Table has two summary fields [COST] and [QUANTITY].  

A measure called [VALUE] is defined AS:  Value = CALCULATE(SUM('TABLE'[Cost]) * SUM('TABLE'[Quantity]))

This measure is included in the Columns on the Table Visualization and is displayed correctly for each row.

 

However, turning on the Totals results in a very wild value (trillions) for the [VALUE] measure.

Should this calculation be moved back to the Table creation? What is the best way to obtain the correct table total? 

 

In Advance, thank you for your input to this solution.

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Blevels 

 

First, change your measure to this:

Value =
SUMX ( 'TABLE', 'TABLE'[Cost] * 'TABLE'[Quantity] )

 

And read this blog post to find out how to manage this situation:
https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total


If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Blevels 

 

You can try the following methods.

Value = CALCULATE(SUM('Table'[COST])*SUM('Table'[QUANTITY]))
Measure = IF(HASONEVALUE('Table'[Part]),[Value],SUMX('Table',[Value]))

vzhangti_0-1667975685726.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi @Blevels 

 

First, change your measure to this:

Value =
SUMX ( 'TABLE', 'TABLE'[Cost] * 'TABLE'[Quantity] )

 

And read this blog post to find out how to manage this situation:
https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total


If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

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.