Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |