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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
sfink22
Helper I
Helper I

Multiplying across tables

I'm trying to create some matrix visuals in my dashboard for some product manufacturing information. 

 

I have three tables that are related in my model by my primary key, Recipe. The Recipe table has a 1:Many relationship with the Volume table, and a 1:Many relationship with the Component Mixes table, like this:

 

"Volume" * - 1 "Recipe" 1 - * "Component Mixes"

 

Each Recipe has 3 components, and the mix of components may be different between recipes. There are also 6 different production sites, and not all Recipes are made at each site. Here is an example of my current table setup:

 

Volume Table

RecipeVolumeSite
1100A
1200B
1150C
1500D
150E
250B
250D
2100E
2200F
350A
325C

 

Component Mixes Table

RecipeComponent% Mix
1AA25%
1BB50%
1CC25%
2DD25%
2BB50%
2CC25%
3EE60%
3FF30%
3CC10%

 

I'm looking to multiply between two of those tables, "Component Mixes" and "Volume", which are linked together with the Recipe table between them. I want to create matrix  #1 that tells me the overall volume of each component by recipe, regardless of site. It should look like this:

 

ComponentRecipe 1Recipe 2Recipe 3
AA25000
BB5002000
CC250507.5
DD01000
EE0045
FF0022.5

 

Matrix #2 is similiar, but instead of having Recipes as the columns, it would have Sites (so the total volume of components produced at each site).

 

ComponentSite ASite BSite C
AA (etc.)   

 

I've been trying to use Related functions, which are returning some values, but the values aren't correct. Any help is appreciated!

1 ACCEPTED SOLUTION

Hi, @sfink22 

Sorry that I missed to fix the total.

Please replace the measure to the below.

 

Result =
SUMX (
VALUES ( Recipe[Recipe] ),
CALCULATE (
SUMX ( Component, Component[% Mix] ) * SUMX ( Volume, Volume[Volume] )
)
)

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @sfink22 

Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

 

Picture1.pngPicture2.png

 

 

https://www.dropbox.com/s/xucuedhs8p8g5bs/sfink22.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Thank you so much! This appears to work perfectly for everything except for the Total column, where I am getting crazy huge numbers. Any idea why they aren't totaling across the rows properly?

Hi, @sfink22 

Sorry that I missed to fix the total.

Please replace the measure to the below.

 

Result =
SUMX (
VALUES ( Recipe[Recipe] ),
CALCULATE (
SUMX ( Component, Component[% Mix] ) * SUMX ( Volume, Volume[Volume] )
)
)

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Thank you, this worked perfectly!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.