Reputation: 153
I would like to ask for your help with solving following problem:
Team Income Date
Sales 5000$ january 2020
Marke 2000$ march 2021
Team Costs Date
Sales 3000$ january 2020
Marke 1000$ march 2021
What I would like to do is to create a new calculated table that looks like that:
Team Income Costs Date
Sales 5000$ 3000$ january 2020
Marke 2000$ 1000$ march 2021
There is relation between those two tables on Date column. I tried many different formulas with Summarize, SummarizeColumns but nothing seems to solve my problem.
Could you please give me a tip how to calculate that?
Many thanks in advance.
Upvotes: 1
Views: 583
Reputation: 30344
I presume your relationship should be based on Team and Date. If this is this case, the following should work.
NewTable = ADDCOLUMNS( IncomeTable,
"Costs", CALCULATE(MIN(CostsTable[Costs]), TREATAS( SUMMARIZE(CostsTable, CostsTable[Date], CostsTable[Team]), IncomeTable[Date], CostsTable[Team] ) ))
Upvotes: 1