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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ezedayplas
New Member

Sorting SUM to match an ID, multiply by value attached.

Hello everyone, I am pretty new to power BI.

 

My challenge today is to get an added weight sold of different products, each with a different weight. I have a sales table where one of the columns is the quantity sold in one single sale (linked to a single product), which I have to compile for a determinated time frame to get the number of products sold. Then I multiply that number to the weight attached to the product in another table.

 

I was able to pull off doing this a product at a time (pretty simple really), but my objective is to add however many as I want at the same time, each one having its own correct sales-weight relation.

 

I have tried multiple things but I cannot seem to get it right.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Can you share sample data and sample output?

 

But a few solutions which can help you without going into the details. get weight into sales table as a new column and use it. Or have a measure based on a common dimension.

new column in sales = sumx(filter(weight[product]=sales[product]),weight[weight])
new column in sales = maxx(filter(weight[product]=sales[product]),weight[weight])

Measure = sumx(summarize('product dim','product dim'[product], "_qty",sales[qty],"_wt",sum(weight[weight])),[_qty]*[_wt])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

G

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Can you share sample data and sample output?

 

But a few solutions which can help you without going into the details. get weight into sales table as a new column and use it. Or have a measure based on a common dimension.

new column in sales = sumx(filter(weight[product]=sales[product]),weight[weight])
new column in sales = maxx(filter(weight[product]=sales[product]),weight[weight])

Measure = sumx(summarize('product dim','product dim'[product], "_qty",sales[qty],"_wt",sum(weight[weight])),[_qty]*[_wt])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

G

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you @amitchandak and everyone for your replies.

So each of the Sales table rows is an individual sale, each with its own quantity of products sold. I could make a calculated column to just have the weight of each sale in every row, which would most likely work. I haven't really worked with columns before, I'm trying to do Sales[units] * RELATED(Products_Weight[unitWeight]) but nothing really happened. The Sales and Products_Weight tables aren't directly related, they have another Dim_Products table in between, don't know if that is the problem.

Ok, nevermind. Adding the weight of each sale to the Sales table actually worked, thank you very much, cheers!

bfernandez
Resolver II
Resolver II

Hey @ezedayplas 

 

Can you provide screenshots and what your expected outcome should be?

smpa01
Super User
Super User

@ezedayplas  would help if you can share some sample data (which can be copy pasted in excel) representative of your problem with the desired outcome clearly shown

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.