Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 | |||||||||
| date | cost | sales | cost per day | date | sales | cost per day | ||||
| 10/5/2021 | "cost is fixed at 10 because <2022" | 70 | "=" cost *sales per day | 30/4/2021 | 70 | "=" table1[cost] *sales per day | ||||
| 10/20/2021 | 40 | 9/29/2021 | 67 | |||||||
| 1/5/2022 | 3 | 21 | 1/5/2022 | 50 | ||||||
| 9/4/2022 | 6 | 68 | 9/4/2022 | 190 | ||||||
| 9/5/2022 | 7 | 55 | 9/5/2022 | 90 | ||||||
| 9/6/2022 | 3 | 65 | 9/6/2022 | 55 | ||||||
| 9/7/2022 | 4 | 89 | 9/7/2022 | 120 |
Hi @Anonymous
please create a calculated column in table2
cost per day =
Table2[Sales] * AVERAGEX ( RELATEDTABLE ( Table1 ), Table1[Cost] )
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?
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.
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 10 |