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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Multiply table1 column 1 from table 2 column 2

I have this table here i want to multiply cost from table 1 into sales from table 2 any help? i build a relationship with table 1 and table 2 according to the date with caardianilty many to many and cross filter to both.

 

Table 1      Table 2   
 datecostsalescost per day   datesalescost per day
 10/5/2021"cost is fixed at 10 because <2022"70"=" cost *sales per day   30/4/202170"="  table1[cost] *sales per day
 10/20/2021 40    9/29/202167 
 1/5/2022321    1/5/202250 
 9/4/2022668    9/4/2022190 
 9/5/2022755    9/5/202290 
 9/6/2022365    9/6/202255 
 9/7/2022489    9/7/2022120 
6 REPLIES 6
tamerj1
Super User
Super User

Hi @Anonymous 

please create a calculated column in table2 

cost per day =
Table2[Sales] * AVERAGEX ( RELATEDTABLE ( Table1 ), Table1[Cost] )
tamerj1
Super User
Super User

Hi @Anonymous 

since the relationship is many to many that means in some dates there is multiple costs. Therefore you have to provide a preference on which price would you like to consider; the max, min or average?

Anonymous
Not applicable

well i dont want any of that i just want to multiply the cost by the sales no average no min no max just cost * sale and thats it any clue?

@Anonymous 
I believe you misunderstood my reply. 
in some instances you might not have a single value of the cost rather it will be multiple cost values in a single day. Then providing a preference is not an option it is a must. 

Anonymous
Not applicable

thats true but what can i do in that case

I guess the average value would be a good estimate? I have no idea about the structure and full meaning of your data. This is a decision that has to come from the business responsible. In the following reply I will post a proposed code 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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