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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
twister8889
Helper V
Helper V

Wrong Total line table

Hi guys,

 

I don't understand how to change the total of the values in my table. It's possible to show values by Type? In this case, the total values will be 10  (When I select the one Product or one Category the values is correct, 10. However when I don't have any selection or when I select all Product or all Category is incorrect 20). Currently, my dax is: CALCULATE ( SUMX ( table1;  table1Value ))

Calculate total img.png

1 ACCEPTED SOLUTION

@twister8889 Just change your measure to this:

 

 

 

Value = 
  IF(
    HASONEVALUE([Product]),
    sum([Values]),
    SUMX(SUMMARIZE('Table',[Product],[Category],[Type],[Month],"Sum",SUM([Values]),[Sum])
  )

 

 

Sorry, posted the wrong thing earlier, I edited it.

 

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@twister8889 This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
PaulDBrown
Community Champion
Community Champion

@twister8889 

Your measure is actually returning the correct value. (Measures always do!)

How are you calculating an expected total of 10?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






First of all, thank you for your answer..

 

@amitchandak I tried but doesn't work

@PaulDBrownI hope the total values can be by Type, independent the number of lines of product and category, I would like the total values can be evaluated by Type, like when I do the selection of Product or Category. If I select at least one Product or Category, I will have two lines with Value equal 10, and the total is 10. 

Calculate total img2.png

My Value DAX is Value = sum(Values)

Make sense?
@Greg_Deckler  I will try to understand, thank you

@twister8889 Just change your measure to this:

 

 

 

Value = 
  IF(
    HASONEVALUE([Product]),
    sum([Values]),
    SUMX(SUMMARIZE('Table',[Product],[Category],[Type],[Month],"Sum",SUM([Values]),[Sum])
  )

 

 

Sorry, posted the wrong thing earlier, I edited it.

 

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@twister8889 , it can be 20 by the logic you are telling, Logic for grand total 10 ?

sumx(summarize(Table, Table[Type], "_1", max(Table[Value])),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.