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
jdelacrettaz
Frequent Visitor

calculating the sum of Measure

hello good afternoon, I have a question that I can not solve. I have 2 tables in which in one I have all the sales with each article and another table with the data of the articles where I have the weight, etc. I need to get the amount of kilos per sale and I did the function. Quantity x weight = sum (salesxdia. [Quantity] * sum (article. [Weight]) Now what you are doing to me is multiplying the total sum of weight by the total sum of quantity.  I need a formula to add the column quantity x weight

power bi.jpg

I need this result

 

power bi2.jpg

 

 

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@jdelacrettaz there are few way to solve this but this is easiest assuming your sales relationswhip with article table is one to many, one on article side and many on sales side. If this is the case, just add new column in sales table using following DAX and then do the sum on this column in your visual

 

Qty with Weight = 
Sales[Qty] * RELATED ( Article[Weight] )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @jdelacrettaz ,

 

SUMX should help you in your scenario. Please create a measure like this to work on it.

 

Measure = SUMX(Your table, [sum])

 

If it doesn't meet your  requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
parry2k
Super User
Super User

@jdelacrettaz there are few way to solve this but this is easiest assuming your sales relationswhip with article table is one to many, one on article side and many on sales side. If this is the case, just add new column in sales table using following DAX and then do the sum on this column in your visual

 

Qty with Weight = 
Sales[Qty] * RELATED ( Article[Weight] )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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