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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jjmauras
Advocate I
Advocate I

Multiplying between Tables

This seems like it should be an easy objective but I cannot figure it out. Any help is appreciated.

All I want to do is create a New Column that multiplies 2 different rows. The rows exist in two different Tables that have an existing relationship. Google has been no help. In my example below I want to multiply "Qty To Pick" by "Unit Price". The relationship is the "Identifier" which is the "Order No" concatenated with "Item ID". Thanks again.

 

Untitled.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Just to clarify on 1 to many relationships:

 

* From the "Many" side, you can use RELATED(OneSideTable[Field]) just fine.  As there is... only 1 row that will match.

* From the "One" side, you can use RELATEDTABLE(ManySideTable) as get all rows associated with the one side... and do something w/ those rows.  eg:  =SUMX(RELATEDTABLE(ManySideTable), ManySideTable[Price])

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi everyone, 

 

I need your support please, I have two tables as shown below for example and I need to multiply values from the two tables together where IDs are equal. Any ideas?

 

Table 1 Table 2
IDValue IDValue 
x1 y4 
y2 z5 
z36 

 

 

 

 

Greg_Deckler
Super User
Super User

Not sure if you meant "multiplies 2 different rows" or "2 different columns". First, you need to make sure both columns are numeric, which is suspect since "Qto To Pick" does not have a summation symbol in front of it. Next you will probably have to create a measure for "Unit Price" in the p21_view_oe_line table, something like SUM or AVERAGE('p21_view_oe_line'[Unit Price]). You could then create a column in the p21_view_mt_pix_tix_detail that would be something like "=[Qty To Pick] * 'p21_view_oe_line'[New Measure]" where New Measure is the measure you created. Might be able to get away with not create the measure and then the formula would be "=[Qty To Pick] * 'p21_view_oe_line'[Unit Price] 

 

Any chance you can post sample or mocked up data and the expected outcome?



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...

Thank you but in this situation I don't think I can Sum or Average the Unit Price and get the desired results. Sorry I did mean "multiply columns". I also changed Qty To Pick as numeric but I'm no closer.

 

Another question I have is since there is a relationship why isn't the Related() function working. I could just pull over the Unit Price into the table with Qty To Pick then just multiply them in a new column. For Example why doesn't this work:

 

in the p21_view_mt_pix_tix_detail table create a new column:

=Related('p21_view_oe_line[Unit Price])

I figured out the problem. For future reference. I have a Many-to-One relationship between these tables.

 

One - p21_view_mt_pix_tix_detail

Many - p21_view_oe_line

 

I was unaware you can not call a Many table into a One table. I'm pulling everything into the Many table and that seems to be working for me.

 

Anonymous
Not applicable

Just to clarify on 1 to many relationships:

 

* From the "Many" side, you can use RELATED(OneSideTable[Field]) just fine.  As there is... only 1 row that will match.

* From the "One" side, you can use RELATEDTABLE(ManySideTable) as get all rows associated with the one side... and do something w/ those rows.  eg:  =SUMX(RELATEDTABLE(ManySideTable), ManySideTable[Price])

 

I need a similar solution but I have Many to Many relationship. 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.