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
jfieck123
Frequent Visitor

I am getting A Circular dependency was detected when I shouldn't be.

I upgrded to Version: 2.66.5376.2521 64-bit (February, 2019).  Not sure this is related to the upgrade but now 

I am getting messages saying "A circular dependency was detected."  The odd part is that it references objects that are not in any of the colums measures or tables that I am trying to use.  The error actually references another column.

 

Its difficult to articulate here but to try and show it what I did was create a custom column which only references one other measure on another table.  You can see from the error it's t_PercGCAPlan[col_%SystemsOnGCA]  .  This was the error I got when this object still existed.  But you can see from the header it's only supposed to be looking at m_PercIncsFingerprinted which does not reference this col_%SystemsOnGCA object.

 

So what i did was then deleted every single object in the report except for the one here with the circular reference and it never went away.  For some reason this version is creating circular references and hanging onto them after the object its telling you is circular has been deleted.   I can provide the report as well.   But wondering if this was some kind of known issue in this updated verion?

 

circ_ref.jpg

 

7 REPLIES 7
d_gosbell
Super User
Super User

It looks like you might be trying to bring a measure and materialize it as a calculated column. As a general rule it is not a good idea to do this.

 

The problem with doing this is that in order to calculate a measure at a row level, the measure has to pull in the values for every other column in that table to use as a filter condition. So if you add two measures (or two expressions using CALCULATE) you get a problem where measure1 needs to calculate measure2 in order to apply it as a filter and measure2 needs a value for measure1. Hence you get stuck in a circular dependency.

 

But I'm not sure why the error did not go away when you deleted things. Maybe it had cached the error and was expecting you to alter the column expression.

 

I did a quick test and I could create a similar issue just adding 2 calc columns using CALCULATE to the one table. The circular error message does appear to stick even when I deleted the other column. But when I made any change to the column with the error (even adding a space to the end) it forced it to re-check the calculation and the warning went away.

Thanks a lot for the reply.  I still think this may be some kind of bug.   What I'm trying to do here that is producing the circular reference I was able to do on the set of objects that are being refrerneced in the error.

 

So to generalize:

Say I have four tables:  TABLE1, t_SubTable1  and TABLE2, t_SubTable2   .

And that TABLE1 has a measure, call it T1_measure that uses the calculate function to generate rate based on other columns in TABLE1. 

t_SubTable1 has a column  called plan and t_SubTable2 has a column called plan

I then create a custom column in t_SubTable1 call it custCol_t_SubTable1 .  <<----  This custom col is the key to this here

This custom column is able to reference the TABLE1.T1_measure and compare it to the t_SubTable1.custCol_t_SubTable1 .

No circular references are reported.

 

Now it gets interesting....

 

I then try to duplicate the exact procedure above on the second set of tables.

I create the measure T2_measure which also uses calculate to generate a rate using objects from only the TABLE2 table.

Then I create a custom column  custCol_t_SubTable2 in the t_SubTable2 table.  

 

Now when I reference the T2_measure from custCol_t_SubTable2 I don't get the circular reference.

Now if I add a reference to t_SubTable2.plan I get the circular reference.  But what is amazing is that error message for the circulare dependancy detection calls out t_SubTable1.custCol_t_SubTable1 .

 

I have tried renaming the custCol_t_SubTable1 but the error hangs onto it. 

I have even tried deleting custCol_t_SubTable1.  This allows me to create the custom column on t_SubTable2 but when I go back and try to recreate the custCol_t_SubTable1 custom column it shows another circular reference.

 

So something sure seems eskew given my second object is no calling anything from the first set of tables and there was no circular reference doing the same set up on the first set of tables.  

 

anyone...  🙂

Again thanks for the reply.  When I say "I have tried renaming the custCol_t_SubTable1 but the error hangs onto it." what I mean is that even after changing the name of the custom column the error message still reflects the old name.  It won't ever update to reflect the changed name in the error message.

 

Let me submit another set of info with the measures and how they are operating and I will attach the report itself.

I just need to obfuscate some of data records.

 

This will take a moment but I'm working on it.  And thanks again for sticking with this one.

 

Also, if after this review we are all convinced that its a bug (not there yet I know) how at that point does one notify the MS engineerins so they can grind on it?



 When I say "I have tried renaming the custCol_t_SubTable1 but the error hangs onto it." what I mean is that even after changing the name of the custom column the error message still reflects the old name.  It won't ever update to reflect the changed name in the error message.

 


Oh, I see. Yes there is definitely a UI bug there where the warning message only gets refreshed when you edit the current measure. It does not appear to refresh when you edit a dependency. 

 


Let me submit another set of info with the measures and how they are operating and I will attach the report itself.

I just need to obfuscate some of data records.

That would be great. We don't need real data, in fact if you can simplify the issue down to the minimum number of tables and columns it makes it easier to understand.

 


Also, if after this review we are all convinced that its a bug (not there yet I know) how at that point does one notify the MS engineerins so they can grind on it?

If this does appear to be a bug you can log an issue at https://aka.ms/issues.powerbi.com - but having an example model will definitely help with this process. And if this is a bug in the calculation engine because I can try checking through some MVP channels to see if this is something that the MS engineers are aware of. 

Great.  Okay.  I'm working on isolating the issue and will post shortely. 

Thanks again for the help on this one.  Unfortunately I can't circulate my file because I can't show the issue without data and the data is proprietary.  I'm convinced there is something odd going on in the client because I am able to set up the measure on one table but then it fails on another.  

 

Anyway I went ahead and changed how the report works to get around it.  Thanks again.

It's possible that there might be a bug in the circular reference detection, but one of the key things that you have not mentioned here is your relationships. The calculate function brings in filter context from related tables, so if you have any common related tables, specially if they have bi-directional relationships this could be a factor.


 

I have tried renaming the custCol_t_SubTable1 but the error hangs onto it. 

 


PowerBI usually fixes any referencing objects when you do a rename, so I don't think doing this would break a circular reference.

 

As a general rule it is best to avoid referencing measures (which are wrapped in an implied CALCULATE) or using CALCULATE directly in a calc column. I have not come across any situations yet where the same logic could not be applied in a measure using an iterator function like SUMX, MAXX, etc. Or sometimes you can push the logic or parts of it down to the query. 

 

These issues can be subtle and it's difficult to be sure if this is a bug or not without seeing an example model with the broken calcs.

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.