Reply
doddsb
New Member

Sum Product per Column Value

Hey y'all,

 

I'm new-ish to Power BI, started a couple months ago creating reports for my workplace, and I'm struggling to represent a particular field of data. This report needs to display the goal hours and actual hours for manufacturing, the actual hours work perfectly fine as for that data source, the numbers just get summed and attributed to the correct department. The goal hours are where there's trouble, those come from a document which outlines the department, location, and manufacturing line, and what the goal hours are for each combination of those. So for example:

PowerBITable.png

In the visual in Power BI, it will sum up correctly per manufacturing line, but the grand total is all wrong. I've exhausted many different formulas, but the current one I have is this:

SUM('DepartmentGoals'[Hours]) * DISTINCTCOUNT(ProductionData[SerialNum])

I see why it isn't working, per line it's fine as it'll multiply the goal number for that department and line by the count for that line and department, but for the grand total, it's adding the goal hours together (32.43 + 69.27 + 21.39 + 7.60) and then multiplying by the total count of items. I need some kind of "For each line, multiply goal hours by item count, then sum", but I'm not sure how to do that, and I've exhausted days researching and trying everything I could find and think of. We even have a Power BI expert through one of the company consultants, and working with him he's stumped too. If anyone might have any ideas or suggestions to correct this formula to get the right values and grand total, it would be super appreciated, thank you.
 
Thanks,
Brandon
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@doddsb 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



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
doddsb
New Member

The Final Word link got me the DAX I needed to work with, after some tinkering managed to finally get all the values displaying and subtotaling correctly, thank you so much!

Greg_Deckler
Super User
Super User

@doddsb 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



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
avatar user

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)