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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply

multiplier effect on summed value

I having trouble figuring out why one of my measured values when summed in a table seems to be a multiplied value of correct value.

 

If you look at the HL_Prod column and see the summed result at the bottom line, you'll see what I mean.  The line level HL_Prod numbers are correct the sum of them is approxmiately three times the amount as the sum shoudld be 138 instead of 418.

 

formerlyknownas_1-1619020613775.png

 

The measure for HL_Prod looks like: 

 

HL_Prod = SUM('results (2)'[ProdQty]) * SUM('results (2)'[HL_UNIT])

 

 

It's baffling for me since line level output of HL_Prod as pictured is correct, but perhaps I have made the measure in such a way that explains this doubling effect?

 

Any insight is greatly appreciated.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@formerlyknownas , Try like


HL_Prod = SUMX('results (2)','results (2)'[ProdQty] * 'results (2)'[HL_UNIT])

 

or using group by of your visual , say city, date etc

HL_Prod = SUMX(values('results (2)'[Group]),calculate(sum('results (2)'[ProdQty]) * sum('results (2)'[HL_UNIT])))

View solution in original post

2 REPLIES 2

Thanks so much!  The SUMX line you suggested solved the issue.  I had used the Quick Measure funcitonality of Power BI to do the multiplication and create the measure as I had shared previsouly.  Do you mind sharing why SUMX approach was the way to go?  

amitchandak
Super User
Super User

@formerlyknownas , Try like


HL_Prod = SUMX('results (2)','results (2)'[ProdQty] * 'results (2)'[HL_UNIT])

 

or using group by of your visual , say city, date etc

HL_Prod = SUMX(values('results (2)'[Group]),calculate(sum('results (2)'[ProdQty]) * sum('results (2)'[HL_UNIT])))

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors