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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
maj_a
Regular Visitor

Column Total incorrect for my measure

Hi All,

 

I am dealing with a situtaion where my total for a measure is not correct. I have read a few solutions here and tried them all but none have resolved the issue in my report. Here is what I am dealing with.

 

I am using a Switch statement, which has 4 conditions to be evaluated with each providing one result (only one is true per row). All the conditions and results are based on measures that I have built in the report. The Switch condition works well and gives me expected results per row; however, the total for the column is not correct. I have tried HASONEFILTER and HASONEVALUE to use SUMX(SUMMARIZE(),Measure) as an esle statement for the Total context in the report. None of what I have tried has worked so far and I would really appreciate if someone can help.

 

Switch:

Volume Variance =

SWITCH(TRUE(),
[Volume (base)]=0 && [Volume (comparative)] = 0,0,
[Volume (base)] <> 0 && [Volume (comparative)] = 0, [Gross Margin (base)]- [Gross Margin W/FX (comparative)],
[Volume (base)] = 0 && [Volume (comparative)] <> 0, [Gross Margin (base)] - [Gross Margin W/FX (comparative)],
[Volume (base)] <> 0 && [Volume (comparative)] <> 0, ((([Total Volume (base)] * ([Volume (comparative)]/[Total Volume (comparative)]))- [Volume (comparative)]) *[PV Gross Margin W/FX (comparative)]), 0)
 
Report Layout:
Incorrect Total.png

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@maj_a Would need information on your raw data and how you are filtering things or exactly how things are laid out in your visual. Sounds like you have seen the below article links but generally you get your table in the exact same form as in the visual with the same filters, etc. Use ADDCOLUMNS to add your measure and then SUMX across that table.

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
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...

Hi Greg,

 

My measures are all derived from one single table, which is connect to Date and Trx type (active relation), and Date Comparative and Trx Comparative (inactive relation). I am using USERLATIONSHIP for any of my measures that are "(Comparative)" and use inactive tables. The ADDCOLUMNS that you have suggested, I am not sure which step should I add that to? Or do I create a new measure for it?

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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.