Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |