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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
loloheat
New Member

Creating Column with Formula

My formula keeps saying it is an error. How can you fix a circular dependency that was detected in the formula? It is something like this

Net Income Adjusted = [Revenue]-[Driver Pay]-[Fuel Cost]-[M&R Cost]-[Equipment Cost]-[Overhead Cost Adjusted]
2 ACCEPTED SOLUTIONS
Bibiano_Geraldo
Community Champion
Community Champion

Hi @loloheat ,
Circular dependency errors in DAX occur when a calculated column or measure depends on itself, either directly or indirectly. To resolve this, you need to break the dependency loop.

For your specific case, you can try using variables to break the dependency. Here’s an example:

Net Income Adjusted = 
VAR Revenue = [Revenue]
VAR DriverPay = [Driver Pay]
VAR FuelCost = [Fuel Cost]
VAR MRCost = [M&R Cost]
VAR EquipmentCost = [Equipment Cost]
VAR OverheadCostAdjusted = [Overhead Cost Adjusted]
RETURN
    Revenue - DriverPay - FuelCost - MRCost - EquipmentCost - OverheadCostAdjusted

 

By using variables, you ensure that each part of the calculation is evaluated independently, which can help avoid circular dependencies.

If the issue persists, you might need to review the dependencies between your measures and calculated columns to identify and resolve any indirect dependencies.

 

Let me know if this helps


I hope this helps! 🎯
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
👍 Give it a kudo to show your appreciation!

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 

View solution in original post

v-yohua-msft
Community Support
Community Support

Hi, @loloheat 

The circular dependency error you encounter is usually because the formula directly or indirectly references itself, making it unresolvable by Power BI. Maybe you can check the following links:

vyohuamsft_0-1731898690695.png

Understanding circular dependencies in DAX - SQLBI

 

Circular Dependency between Calculated Columns in ... - Microsoft Fabric Community

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yohua-msft
Community Support
Community Support

Hi, @loloheat 

The circular dependency error you encounter is usually because the formula directly or indirectly references itself, making it unresolvable by Power BI. Maybe you can check the following links:

vyohuamsft_0-1731898690695.png

Understanding circular dependencies in DAX - SQLBI

 

Circular Dependency between Calculated Columns in ... - Microsoft Fabric Community

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Bibiano_Geraldo
Community Champion
Community Champion

Hi @loloheat ,
Circular dependency errors in DAX occur when a calculated column or measure depends on itself, either directly or indirectly. To resolve this, you need to break the dependency loop.

For your specific case, you can try using variables to break the dependency. Here’s an example:

Net Income Adjusted = 
VAR Revenue = [Revenue]
VAR DriverPay = [Driver Pay]
VAR FuelCost = [Fuel Cost]
VAR MRCost = [M&R Cost]
VAR EquipmentCost = [Equipment Cost]
VAR OverheadCostAdjusted = [Overhead Cost Adjusted]
RETURN
    Revenue - DriverPay - FuelCost - MRCost - EquipmentCost - OverheadCostAdjusted

 

By using variables, you ensure that each part of the calculation is evaluated independently, which can help avoid circular dependencies.

If the issue persists, you might need to review the dependencies between your measures and calculated columns to identify and resolve any indirect dependencies.

 

Let me know if this helps


I hope this helps! 🎯
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
👍 Give it a kudo to show your appreciation!

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 
pbiuseruk
Resolver II
Resolver II

Hi,

It could be to do with your relationship set up or it could be that you're doing something like the below:

  • Column A = [Column B] + 1
  • Column B = [Column A] - 1

If you do this above, then Power BI won't know what order to process things in and it creates a circular dependancy. Make sure the fields/measures you're using in that formula are independant.

Please let me know if this helps.

 

 

Greg_Deckler
Super User
Super User

@loloheat Next to impossible to provide an answer with the information provided. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.