Forum Discussion
Circular Dependency
- 1 year ago
Hi Anonymous ,
Thank you for reaching out to the Microsoft Community Forum.
Thank you burakkaragoz , for posting reponse in this community and thank you for your suggestions and workarounds.
Hi Anonymous ,
Please check below things to fix the issue.
1. Move Logic to Power Query
Avoid calculated columns in DAX for things like this, especially if they involve values from other tables.
Go to Power Query (Transform Data). Merge New Project Data with CombinedDispatches using Project Definition. Bring in the Financial Year column from CombinedDispatches during the merge. Construct your LinkKey in Power Query using the now-available Financial Year.
Note: Power Query flattens your data before the data model loads, breaking the circular dependency.
2. Use a Bridge Table
If merging isn’t feasible, Create a Project Definition Bridge Table with unique Project Definition and Financial Year. Link CombinedDispatches, New Project Data, and StandardCost all to this bridge using Project Definition (and Financial Year if needed). Ensure you are not computing values across these tables in ways that reintroduce implicit relationships via calculated columns.
Please avoid below things.
Using DAX-calculated columns to pull in fields from related tables and then using those same fields to build relationships. Creating bi-directional filters unless absolutely necessary.
3. Move the Financial Year lookup to a separate helper table:
Create a new table that maps Project Definition to Financial Year. Use this table to populate Financial Year in New Project Data without referencing LinkKey.
Calculate Financial Year first. Ensure Financial Year is calculated independently of LinkKey. Then use it to build LinkKey.4. Use Power Query instead of DAX:
Perform the lookup and column creation in Power Query (Get & Transform) before loading the data into the model. This avoids circular logic in the data model.
Please refer community threads.
Solved: Need Help in Resolving Circular Dependency - Microsoft Fabric Community
Solved: "A circular Dependency was detected" error while c... - Microsoft Fabric Community
Solved: Circular dependency - Microsoft Fabric Community
Solved: Circular dependency in a calculated column - Microsoft Fabric Community
Solved: Circular dependency in Power Bi - Microsoft Fabric Community
Solved: Circular Dependency on Calculated Columns - Microsoft Fabric Community
Solved: Circular Dependency while creating multiple calcul... - Microsoft Fabric Community
Solved: Calculated table generates a circular dependency w... - Microsoft Fabric Community
Solved: circular relationship - Microsoft Fabric Community
Solved: How to fix circular dependency in two calculated c... - Microsoft Fabric Community
Solved: Circular dependency when sorting by column - Microsoft Fabric Community
Solved: Circular Dependancy when creating Relationship - Microsoft Fabric Community
Solved: Re: Circular dependency - Microsoft Fabric Community
Solved: circular relationship - Microsoft Fabric Community
Solved: How to eliminate a circular dependency? - Microsoft Fabric Community
Solved: Circular Dependency with LOOKUPVALUE - Microsoft Fabric Community
Solved: Circular Dependency with Date Tables - Microsoft Fabric Community
Solved: circular depenency only in Power BI Service but no... - Microsoft Fabric Community
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
- 1 year ago
Hello Anonymous
try this
If you must keep calculated columns in DAX, avoid creating physical relationships and instead use DAX functions like
Column =CALCULATE(
[YourMeasure],
TREATAS(VALUES('New Project Data'[LinkKey]), 'StandardCost'[LinkKey])
)
This avoids circular relationships because TREATAS creates a virtual relationship just for that measure.
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Hello Anonymous
try this
If you must keep calculated columns in DAX, avoid creating physical relationships and instead use DAX functions like
Column =CALCULATE(
[YourMeasure],
TREATAS(VALUES('New Project Data'[LinkKey]), 'StandardCost'[LinkKey])
)
This avoids circular relationships because TREATAS creates a virtual relationship just for that measure.
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.