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
bsmartbkind
Advocate I
Advocate I

Circular Dependency on Calculated Columns

Hello Everybody. Hope you can help me with this issue.

 

I created a calculated column with a simple code, as follows

 

EgrTotGen$Mix =
IF (
    TrxCxP[IDMoneda] = "VES",
    IF (
        [TasaVentaAH] = 0,
        DIVIDE ( TrxCxP[TOTAL GENERAL], [TasaMix], 0 ),
        DIVIDE ( TrxCxP[TOTAL GENERAL], [TasaVentaAH], 0 )
    ),
    TrxCxP[TOTAL GENERAL]
)

 

When I try to create another calculated column exactly as the previous one, but using another rate table, I get the Circular Dependency error.

 

EgrTotGen$BCV =
IF (
    TrxCxP[IDMoneda] = "VES",
    IF (
        [TasaVentaAH] = 0,
        DIVIDE ( TrxCxP[TOTAL GENERAL], [TasaVentaBCV], 0 ),
        DIVIDE ( TrxCxP[TOTAL GENERAL], [TasaVentaAH], 0 )
    ),
    TrxCxP[TOTAL GENERAL]
)

 

Circular Dependency Image.png

1 ACCEPTED SOLUTION
edhans
Super User
Super User

It is a complex issue.

  • WHen you use a measure in another measure (your [TasaVentaAH] ) it is wrapped in an implicit CALCULATE.
  • CALCULATE removes all filters, then reapplies the filters for the row context, so it creates a filter for every single column in the table when you use it in a Calculated column.
  • Then you use CALCULATE (explicitly or implicitly) in another column.
  • Then the first column you created is now referencing the 2nd one, and the 2nd one is referencing the first one.
  • Boom. Circular reference.

There are exceptions to this, but it gets even more esoteric in how Power BI can find a unique field, and you cannot manually do this in Power BI at all. You can in SSAS and oddly enough, Excel's Power Pivot.

 

Bottom line, this is one of many reasons to not use calculated columns. Use measures instead.

 

In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

5 REPLIES 5
abhijit123
New Member

Create Calculated column for one 

& For Another one create measure.

 

or create measure instead of calculated column

edhans
Super User
Super User

It is a complex issue.

  • WHen you use a measure in another measure (your [TasaVentaAH] ) it is wrapped in an implicit CALCULATE.
  • CALCULATE removes all filters, then reapplies the filters for the row context, so it creates a filter for every single column in the table when you use it in a Calculated column.
  • Then you use CALCULATE (explicitly or implicitly) in another column.
  • Then the first column you created is now referencing the 2nd one, and the 2nd one is referencing the first one.
  • Boom. Circular reference.

There are exceptions to this, but it gets even more esoteric in how Power BI can find a unique field, and you cannot manually do this in Power BI at all. You can in SSAS and oddly enough, Excel's Power Pivot.

 

Bottom line, this is one of many reasons to not use calculated columns. Use measures instead.

 

In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Thanks, buddy. You gave me the solution by mentioning that the problem was to my measure [TasaVentaAH]. I have replaced the measure with a column and already the model is working. In any way it is clear to me that I must study a lot on the subject. Best regards.

 

Francisco.

 

Apologyze for my poor english.

Yes @bsmartbkind - This is a small but critical thing in how Calculated Columns work. There are two chapters on CALCULATE and Context Transition in this book and this calc column circular reference issue is 2-3 pages in that section. 

 

Glad I was able to help.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors