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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
CarlsBerg999
Helper V
Helper V

DAX multiply two columns in separate tables

Hi,

 

I have two tables. Table one:

 

ProductSold qty
Product 1

  1

Product 2  2
Product 3  51

 

Table two:

ProductPrice
Product 1  50€
Product 2  100€
Product 3

  25€

Product 430€
Product 5  25€

 

The goal is: Sold qty * Price for each product. Outcome would be:

 

ProductTotal sales
Product 1  50€
Product 2  200€
Product 3  1275€

 

I know i could just merge these two tables in Power Query and make a calculated column. However, i want to do this with a DAX measure. How do i do this? (what kind of a relationship and DAX measure is required?)

 

Thanks for your help in advance!

1 ACCEPTED SOLUTION

hello @CarlsBerg999,you can calculate revenue using DAX as below screenshot shown

Sales_DAX de productos: PRODUCTX(Product_Qty, Product_Qty[Sold qty]* RELATED(Product_price[Price]))
Sales DAX.jpg

Sumanth_23_0-1600275364277.png

Please mark the post as a solution and provide a 👍 if my comment helped resolve your issue. Thank you!

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@CarlsBerg999 , new column in table 1

 

maxx(filter(Table2, Table2[product] = Table1[product]), Table[Price]) * Table1[Qty]

 

or

related(Table[Price]) * Table1[Qty]

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

 Hi, The second one (related.....) works fine as a new column. What is the idea behind the the: maxx(filter(Table2, Table2[product] = Table1[product]), Table[Price]) * Table1[Qty] Is this for a measure and if not, is it possible to do the required calculation as a measure rather than a calculcated column?

hello @CarlsBerg999,you can calculate revenue using DAX as below screenshot shown

Sales_DAX de productos: PRODUCTX(Product_Qty, Product_Qty[Sold qty]* RELATED(Product_price[Price]))
Sales DAX.jpg

Sumanth_23_0-1600275364277.png

Please mark the post as a solution and provide a 👍 if my comment helped resolve your issue. Thank you!

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



Hi,

 

The second one (related.....) works fine as a new column. What is the idea behind the the: 

 

maxx(filter(Table2, Table2[product] = Table1[product]), Table[Price]) * Table1[Qty]

 

Is this for a measure and if not, is it possible to do the required calculation as a measure rather than a calculcated column? 

Sumanth_23
Memorable Member
Memorable Member

hi @CarlsBerg999 - You can acheive this by creating a cacluated column; you can setup the 2 tables as seen below. 

 

Sumanth_23_0-1600236649202.png

 

Additionaly you can use the "RELATED" function and build a calculated column to calcuate the Sales

Revenue = Product_Qty[Sold qty] * RELATED(Product_price[Price])

 

Sumanth_23_1-1600236716421.png

 

Please mark the post as a solution and provide a 👍 if my comment helped with solving your issue. Thanks!

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



FarhanAhmed
Community Champion
Community Champion

If you have "Many to 1" or "1 to 1" relationship between ProductPrice and ProductSold table then use "RELATED" in "MANY" side of table to get the value from single side.


Lets say if you have Price table contains single row for each product and Sales table contains quantity sold of each time of product then you should create column in sold table like 

 

Amount = Qty * RELATED (Price [Price])







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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