Forum Discussion
analyticspbi87
Helper I
1 year agoCircular Dependency when using variable in measures
Hi there, Currently, I'm trying to get two different measures to show as follows and am getting an error on the second variable. Building Year Value Type Cost Type Value Thousands Group...
- 1 year ago
You have a couple of typos in your formulas, but there is no circular dependency anywhere.
% of TOTAL A = VAR ANUMERATOR = DIVIDE ( CALCULATE ( SUM ( 'Data'[Value] ), 'Data'[Group] <> "A", 'Data'[Type Cost] = "Add Year" ), 1000 ) VAR ADENOMINATOR = DIVIDE ( SUM ( 'Data'[Multiplier] ) * SUM ( Data[ TOTAL A ] ), 1000 ) RETURN DIVIDE ( ANUMERATOR, ADENOMINATOR ) % of TOTAL B = VAR BNUMERATOR = DIVIDE ( CALCULATE ( SUM ( 'Data'[Value] ), 'Data'[Group] <> "A", 'Data'[Type Cost] = "Add Year", 'Data'[Type] = "Non-Recoverable" ), 1000 ) VAR BDENOMINATOR = DIVIDE ( ( SUM ( 'Data'[Multiplier] ) * SUM ( 'Data'[ TOTAL B ] ) ), 1000 ) RETURN DIVIDE ( BNUMERATOR, BDENOMINATOR )
lbendlin
Super User
1 year agoYou have a couple of typos in your formulas, but there is no circular dependency anywhere.
% of TOTAL A =
VAR ANUMERATOR =
DIVIDE (
CALCULATE (
SUM ( 'Data'[Value] ),
'Data'[Group] <> "A",
'Data'[Type Cost] = "Add Year"
),
1000
)
VAR ADENOMINATOR =
DIVIDE ( SUM ( 'Data'[Multiplier] ) * SUM ( Data[ TOTAL A ] ), 1000 )
RETURN
DIVIDE ( ANUMERATOR, ADENOMINATOR )
% of TOTAL B =
VAR BNUMERATOR =
DIVIDE (
CALCULATE (
SUM ( 'Data'[Value] ),
'Data'[Group] <> "A",
'Data'[Type Cost] = "Add Year",
'Data'[Type] = "Non-Recoverable"
),
1000
)
VAR BDENOMINATOR =
DIVIDE ( ( SUM ( 'Data'[Multiplier] ) * SUM ( 'Data'[ TOTAL B ] ) ), 1000 )
RETURN
DIVIDE ( BNUMERATOR, BDENOMINATOR )
analyticspbi87
Helper I
1 year agoI have revised the dataset to a more similar structure and tried to make the formula in a new PBIX file and still getting circular reference errors.
I have attached them in the following link