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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DeBIe
Post Partisan
Post Partisan

How to solve/understand the circular dependency error?

Hi all!

 

The company that I work for runs a business for invoice processing. In this scenario I work with 2 tables (Header + Lines).

Header means the header information for an invoice such as InvoiceDate, PaymentReference.
Lines means details of an invoice such as ArticleName, ArticlePrice, ArticleVat%.

 

We are keeping track of changes that have been made to invoices (header+lines). For now i want to create a simple column in my Header table which tells me if an invoice has been updated (if header or line has change then True). Therefor I need a formula that checks my Header + Lines Table. I can sum up the values in the Header table where I create the column, but I also need to pull in the sum of the values in the Lines table. The relationship of this table is Header[JournalID] 1 -> * Line[JournalID].

I've created a column with this formula: TotalChanges = Header[UpdatedInvoiceDate] + Header[UpdatedPaymentReference) 
CALCULATE(SUM(Line[UpdateArticleName])) + CALCULATE(SUM(Line[UpdateArticlePrice]))  + CALCULATE(SUM(Line[ArticleVat%])).
After that I created the column IsChanged = IFHeader[TotalChanges]>0TRUE(), FALSE() )
Unfortunately this column can not be created because I will receive the error for circular dependency.

 

Can anyone help me please?

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @DeBIe ,

 

To resolve circular dependency issues, you could consider these solutions.

1.Change Calculated column to Measure.

2.Modify your Calculated column formula with some filters functions like REMOVEFILTERS.

3.Make some changes to the relationships in your model.

4.Edit the view which is used as input.

 

Please take a look at this blog related to how to fix issue of Circular Dependency:

 Circular Dependency between Calculated Columns in ... - Microsoft Power BI Community.

Solved: Circular Dependency - Microsoft Power BI Community

Solved: circular dependency error - Microsoft Power BI Community

Hope it helps you.

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @DeBIe ,

 

To resolve circular dependency issues, you could consider these solutions.

1.Change Calculated column to Measure.

2.Modify your Calculated column formula with some filters functions like REMOVEFILTERS.

3.Make some changes to the relationships in your model.

4.Edit the view which is used as input.

 

Please take a look at this blog related to how to fix issue of Circular Dependency:

 Circular Dependency between Calculated Columns in ... - Microsoft Power BI Community.

Solved: Circular Dependency - Microsoft Power BI Community

Solved: circular dependency error - Microsoft Power BI Community

Hope it helps you.

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

I've been able to quick-fix it by editing the view which is used as input. Thanks for helping!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.