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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PostalPower
Frequent Visitor

How to calculate the grand total for a measure with parameter?

Hello all! I'm having trouble getting the grand total of all rows in a column. The column is a measure of a variable divided by a parameter, with multiple filters, so each individual row has the correct value, but the column total is short. 

 

I have searched many threads with similar problems, and tried several solutions but none have given me what I need. 

 

I'm making a calculator where the user inputs parameters, and filters to certain zip codes they want to add to their machine sortplan. The calculator takes the parameters to find the "1st pass bins" measure. This measure is then used to calculate the number of bins that will be used for each zip/route combination by dividing by the "# sequences" variable. The row values for the zip/routes are correct in the table, but the column total value is the sum of all # sequences divided by the 1st pass bins, rather than each row being added individually; which is what I need. 

PostalPower_0-1679598944760.png

This was my original measure: 

2nd Pass Bins = ROUNDUP(SUM(Main_Carrier_Info[# Sequences])/[1st Pass Bins], 0)
 
Then I tried using the SUMX I read about in a couple threads:
Total 2nd Pass Bins = ROUNDUP(SUMX('Main_Carrier_Info', DIVIDE( Main_Carrier_Info[# Sequences], [1st Pass Bins] ) ), 0)
 
But it's coming out to the same total, 21. I need it to be 26.
 
Then I tried using the ALLEXCEPT, but using both filters again gave me the correct row total but incorrect grand total.
2nd Pass CR Bins = CALCULATE(ROUNDUP(SUMX('Main_Carrier_Info', DIVIDE( Main_Carrier_Info[# Sequences], [1st Pass Bins] ) ), 0), ALLEXCEPT(Main_Carrier_Info, Main_Carrier_Info[Zip], Main_Carrier_Info[Rte Nbr]))
 
I'm not sure what I'm missing? I am relatively new to Power BI, and the only DAX I know is what I have figured out by searching for what I want to do. The simplest help, the better. But I'll take whatever will work. Without the correct grand total, the box that says "Total 2nd pass bins" in the image above will not calculate correctly, which renders this tool useless. 🙂
 
Thanks in advance for the help!

 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@PostalPower First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

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

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8

 

If none of that helps, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



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...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.