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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.