cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtrussardi
Frequent Visitor

Multiply two columns from different table with condition

Hello everyone!

 

I have one column titled ('Unit Cost') from the table named ('Raw Materials') and another column titled ('Rate') from the table ('Exchange Rates'). I would need to mulitply the column 'Unit Cost' times the column 'Rate' when the date is the same for the two tables. How could I do this?

 

Thanks in advance for your time.

 

Please, let me know.

3 REPLIES 3
amitchandak
Super User IV
Super User IV

@mtrussardi , you can use min/max , but aggregation is must



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

amitchandak
Super User IV
Super User IV

@mtrussardi , Create a common date table and then create a measure like

 

sumx(values(Date[date]), Sum(Table1[Unit Cost]) * sum(Table2[Rate]))

 

you can use min/max, average in place of sum

 

refer the concept here: https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak 

 

Thank you for your reply.

 

I tried the measure but the problem is that I don't want to calculate the sum. I just need to calculate the value of 'Unit Cost' times the "Rate' for each row when the date is the same.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors