Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AswinSuresh
New 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 =
    DATEDIFF ( 'Calling List Dimension'[CREATEDATE], _A, HOUR )
RETURN
_C
 
For Column 1, I have taken earliest date from my fact table using minx( ) and relatedtable( ) function and created a calculated column in my Dimension table.

The issue is when create one more calculated colulmn referring to this Calculated column (Column 1) like a calculated column with IF condition on Column 1, I am getting circular dependency error. 
Error msg  : "A circular dependency was detected: Calling List Dimension[Call Log Duration], Calling List Dimension[TAT Bucket], Calling List Dimension[Call Log Duration]."

How to resolve this error and create this new calculated column.
 
Thanks in advance !!!



Column 2  : 


1 REPLY 1
johnt75
Super User
Super 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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.