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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
k33fun
Frequent Visitor

Sum of table column

Hi 

 

I am using a table visual and below is my result for Total table row

 

Gross Sales (MYR) Dax is [Quantity] * [Unit Price]

But the sum of Gorss Sales (MYR) row is not correct, it should be 10,531,720

 

Now it is taking sum of Quantity 14,137 * Sum of Unit Price 247,272 = 3,495,684,264

Can suggest for any solution for this?

 

k33fun_0-1733293228985.png

 

3 ACCEPTED SOLUTIONS
powerbidev123
Solution Sage
Solution Sage

@k33fun , Use SUMX in your DAX. What your measure is doing is just multiplying plainly with quantity to unit price

View solution in original post

anmolmalviya05
Super User
Super User

Hi @k33fun, Hope you are doing good!

The issue you're facing arises because the calculation for Gross Sales (MYR) in the total row is aggregating the quantities and unit prices first, then multiplying the sums, which is not the correct logic. To fix this, you need to ensure that the calculation for Gross Sales (MYR) is performed row by row in the table before summing up.

 

Here’s how to resolve this:

Instead of creating a calculated column, create a measure that calculates Gross Sales (MYR) correctly at all levels, including the total:

 

Gross Sales (MYR) =

SUMX(

'FactTable',

'FactTable'[Quantity] * 'FactTable'[Unit Price]

)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

 

Let's Connect on LinkedIn: https://www.linkedin.com/in/anmol-malviya/?originalSubdomain=in


Subscribe my youtube channel for more Power BI and Microsoft Fabric Updates: https://www.youtube.com/@AnmolPowerBICorner

View solution in original post

Use SUMX instead of SUM.

View solution in original post

6 REPLIES 6
v-csrikanth
Community Support
Community Support

HI @k33fun 

It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered?
If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @k33fun 

I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!

Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @k33fun 
Sorry for the late response.
As highlighted by @Ajithkumar_P_05 @anmolmalviya05 , the proposed approach appears to effectively address your requirements.
Could you please confirm if your issue has been resolved?
If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.

Best regards,

Cheri Srikanth.

Use SUMX instead of SUM.

anmolmalviya05
Super User
Super User

Hi @k33fun, Hope you are doing good!

The issue you're facing arises because the calculation for Gross Sales (MYR) in the total row is aggregating the quantities and unit prices first, then multiplying the sums, which is not the correct logic. To fix this, you need to ensure that the calculation for Gross Sales (MYR) is performed row by row in the table before summing up.

 

Here’s how to resolve this:

Instead of creating a calculated column, create a measure that calculates Gross Sales (MYR) correctly at all levels, including the total:

 

Gross Sales (MYR) =

SUMX(

'FactTable',

'FactTable'[Quantity] * 'FactTable'[Unit Price]

)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

 

Let's Connect on LinkedIn: https://www.linkedin.com/in/anmol-malviya/?originalSubdomain=in


Subscribe my youtube channel for more Power BI and Microsoft Fabric Updates: https://www.youtube.com/@AnmolPowerBICorner

powerbidev123
Solution Sage
Solution Sage

@k33fun , Use SUMX in your DAX. What your measure is doing is just multiplying plainly with quantity to unit price

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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