Forum Discussion
AswinSuresh
3 years agoNew Member
Circular Dependency error - Direct Query to AAS
Hi All, I want to create 2 Calculated columns : - Column 1 : Call Log Duration = VAR _A = MINX ( RELATEDTABLE ( 'Call Logs Ameyo' ), 'Call Logs Ameyo'[CH_DATE_ADDED] ) VAR _C = D...
johnt75
3 years agoSuper User
The problem is that RELATEDTABLE is rewritten internally to CALCULATETABLE and it uses all columns from the expanded dimension table as filters. When you try to add new calculated columns they are added to the table and it will try to use them as filters as well, hence the circular dependency.
You need to remove the filters on all columns in the table except the key column used in the relationship between your dimension table and fact table, e.g.
Call Log Duration =
VAR _A =
MINX (
CALCULATETABLE (
'Call Logs Ameyo',
ALLEXCEPT ( 'Calling List Dimension', 'Calling List Dimension'[Key column] )
),
'Call Logs Ameyo'[CH_DATE_ADDED]
)
VAR _C =
DATEDIFF ( 'Calling List Dimension'[CREATEDATE], _A, HOUR )
RETURN
_C