Hi @wojteq,
This is an open forum, intended so others can learn from previous posted questions but I’ll ask the @EnterpriseDNA team. Please see request below, can you help this member out?
.
As for my second attempt, this is what I’ve got for you (there seems to be a rounding difference) but I don’t have the time to look into that, so I hope that won’t be present in your actual file.
Total Costs wFILTER v3 =
VAR vTable =
ADDCOLUMNS(
GENERATE( VALUES( Branch[BRANCH_NAME] ), VALUES( 'Calendar'[MonthnYear] )),
"@Others", IF( [BRANCH_NAME] <>"od11",
CALCULATE( [Total Costs 2] ,
FILTER( VALUES( FactCosts[CONTRACT TYPE] ),
FactCosts[CONTRACT TYPE] IN {"KK", "KD", "KP"}
),
FILTER( VALUES( FactCosts[CONTRACT_ID] ),
NOT( FactCosts[CONTRACT_ID] ) IN
{"KK200074", "KK300004", "KK300005", "KP000184", "KP000156", "KP000163", "KP000181", "KP000182", "KP000185", "KP000180", "KP000178", "KP000160"}
),
FILTER( VALUES( FactCosts[CONTRACT_ID]),
FactCosts[CONTRACT_ID] <> "KK200073"
)
)),
"@os11", IF( [BRANCH_NAME] ="od11",
VAR MoveContract =
CALCULATE(
CALCULATE( [Total Costs 2],
FILTER( VALUES( FactCosts[CONTRACT_ID]),
FactCosts[CONTRACT_ID] = "KK200073"
)
), ALL( Branch[BRANCH_NAME] )
)
VAR CALCos11 =
CALCULATE(
CALCULATE( [Total Costs 2],
USERELATIONSHIP( FactCosts[BRANCH_NAME_WHO_WORK], Branch[BRANCH_NAME2] )
), FILTER( VALUES( Branch[BRANCH_NAME] ),
Branch[BRANCH_NAME] = "od11"
)
) RETURN MoveContract + CALCos11
)
)
VAR others = SUMX( vTable, [@Others] )
VAR os11 = SUMX( vTable, [@os11] )
RETURN
others + os11
.
With this result.
Here’s your updated sample file. eDNA - Test data.pbix (1.0 MB)
I hope this is helpful.