I have two table that are not related:
Table1:
Table2:
How can I simply add a calculated column that would grab a sum(TotalIncurred) per each PolicyNumber
where DateCreated >=
10/19/2018
So desirable result should be:
Do I need to relate those two tables first?
Or there is a way to calculate it based on PolicyNumber without creating a relationship?
I tried to create a seperate table first, that would group all TotalIncurred and PolicyNumber:
LossesTableTest =
ADDCOLUMNS(
SUMMARIZE(
FILTER(fact_Losses, fact_Losses[PolicyNumber] <> BLANK()),
fact_Losses[PolicyNumber]
),
"TotIncurred", CALCULATE(SUMX(fact_Losses, fact_Losses[TotalIncurred]))
)
And then add calculated column LossPerPolicy
in a main table:
LossPerPolicy =
SUMX(
FILTER(LossesTableTest, LossesTableTest[PolicyNumber] = fact_Premium[PolicyNumber] ),
LossesTableTest[TotIncurred]
)
But the numbers are not correct.