Forum Discussion
efstel
Helper I
1 year agoSubtotal and totals not computing correctly
I have two tables and want to use the values in the table/column 'JCCD'[ActualCost] except when in the values in table/column 'bihj HeavyJob_CostSummary'[HJCost] are higher than in the 'JCCD'[ActualC...
Fowmy
Super User
1 year agoefstel
You need to interate over the table, this will get the sub total right:
NewMeasureCO =
SUMX(
'JCCD',
VAR LMSEO_Value = LOOKUPVALUE('bihj HeavyJob_CostSummary'[LMSEO], 'bihj HeavyJob_CostSummary'[KeyColumn], 'JCCD'[KeyColumn])
VAR HJCost = LOOKUPVALUE('bihj HeavyJob_CostSummary'[HJCost], 'bihj HeavyJob_CostSummary'[KeyColumn], 'JCCD'[KeyColumn])
VAR ActualCost = 'JCCD'[ActualCost]
RETURN
IF(
LMSEO_Value IN {"Labor", "Material"} && HJCost > ActualCost,
HJCost,
ActualCost
)
)
- efstel1 year ago
Helper I
I'm not 100% sure what "KeyColumn" to use in the two tables. I've tried what I thougth was correct, but I keep getting an "Error fetching data" message that states "A table of multiple values was supplied where a sigle value was expected."