Forum Discussion
A Circular Dependency was detected
Hi,
I have done a simple measure but keep getting a message
How do I fix this please
Hi Adavin
are you sure this is a measure and not a calculated column?
In order to help you, I need the pbix file, otherwsie it is impossible. Can you upload it on a shared floder and send em the link here or via private message?
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
6 Replies
- FBergamaschi
Super User
Hi Adavin
are you sure this is a measure and not a calculated column?
In order to help you, I need the pbix file, otherwsie it is impossible. Can you upload it on a shared floder and send em the link here or via private message?
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- krishnakanth240
Super User
Hi Adavin
As FBergamaschi mentioned can you share sample data in text format and image is blurred
- MohamedFowzan1
Super User
Hi Adavin
A circular dependency usually means the measure (or another object) is directly or indirectly referencing itself.
Looking at the error, ASB Continuing appears to be involved in the dependency chain more than once. A few things to check:
- Is ASB Continuing already being referenced by another measure (e.g., BFA_Continuing) that in turn references ASB Continuing?
- If you're trying to create a new version of the measure, make sure it has a different name and isn't overwriting an existing measure.
- Also check whether any calculated columns or calculation groups are referencing this measure and creating a loop.
Could you also share the DAX for BFA_Continuing (or any other measures that reference ASB Continuing)? The dependency chain in the error suggests the circular reference is likely coming from one of those rather than the CALCULATE expression itself.
- AdavinFrequent Visitor
Hello
Thank you for your help.
I need 3 new measures converting the SQL INTO DAX Measures
The 1st one is just [EFA Target]
then I need to recreate a measure in DAX using the following from SQL for 'EFA Continuing'
=COUNTDISTINCT(IF(Fields!FundingSource.Value="EFA 16 19 Funded" AND Fields!CompletionStatusID.Value="1",Fields!RefNo.Value,NOTHING))
The DAX I believe to be
EFA Continuing =CALCULATE(DISTINCTCOUNT('Enrolment Table'[RefNo]),'Enrolment Table'[Funding Source] = "EFA 16 19 Funded",'Enrolment Table'[CompletionStatusID] = "1")Then I would just take [EFA Target]-[EFA Continuing to get my difference
is there a better way
Kindest
- ShivekMaharaj
Solution Sage
Hi Adavin,
The clearer screenshot shows that ASB Continuing has been created as a calculated column, rather than a measure:
The error message also identifies the dependency loop:
ASB Continuing → EFA_Continuing → ASB ContinuingYour formula uses CALCULATE inside the calculated column. In that context, CALCULATE performs context transition and can make the column depend on other calculated columns in Enrolment Table, including EFA_Continuing. If EFA_Continuing has a similar calculation, the two columns end up depending on one another.
Since this calculation returns an aggregated row count, I would create it as a measure instead:
ASB Continuing = COALESCE( CALCULATE( COUNTROWS('Enrolment Table'), 'Enrolment Table'[Funding Source] = "Adult Skills Funded", 'Enrolment Table'[CourseHeader] = "(FT)", 'Enrolment Table'[CompletionStatusID] = "1" ), 0 )Microsoft’s calculation guidance explains that calculated columns are stored for every row, while measures are calculated when needed and respond to the report’s filter context.
I would also review EFA_Continuing. If it is another aggregated count using the same pattern, I would convert that to a measure as well.
That should remove the circular dependency and is a better fit for what these calculations appear to be doing.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.