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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pintobean87
Frequent Visitor

Circular dependency error

Hi all. Been reading and reading and I still don't understand how to solve this problem.

 

I have two calculated columns that are similar, but reference two different sets of date columns (to calculate date differences in days).  Here they both are...

 

_Force&Assign =

VAR max1 = MAX ( 'Table_query'[FORCE Creation Date], 'Table_query'[Date Assigned] )

VAR min1 = MIN ( 'Table_query'[FORCE Creation Date], 'Table_query'[Date Assigned] )

RETURN SWITCH(TRUE() ,ISBLANK(max1)||ISBLANK(min1), BLANK() ,CALCULATE ( SUM ( 'Calendar'[If work day] ), ALL ( 'Calendar' ), DATESBETWEEN ( 'Calendar'[Date], min1, max1 ) ) )
 
 
second one is:
 
_Assign&Award =

VAR max1 = MAX ( 'Table_query'[Date Assigned], 'Table_query'[Date Awarded] )

VAR min1 = MIN ( 'Table_query'[Date Assigned], 'Table_query'[Date Awarded] )

RETURN SWITCH(TRUE() ,ISBLANK(max1)||ISBLANK(min1), BLANK() ,CALCULATE ( SUM ( 'Calendar'[If work day] ), ALL ( 'Calendar' ), DATESBETWEEN ( 'Calendar'[Date], min1, max1 ) ) )
 
 
They both work fine. THE MAIN PROBLEM is that my "Year" filter slicer is not working. When I choose any year, all my visuals go "(blank)".
 
The current established relationship between 'Table_query' and 'Calendar' is the following
pintobean87_0-1682122669943.png

My "Year" filter slicer only seems to work when the cross filter direction is set to both, but if I do that while my two calculated columns above exist, I get this circular dependency error.

pintobean87_1-1682122758029.png

 

Any ideas on how to fix this? Because I am lost.

1 REPLY 1
MFelix
Super User
Super User

Hi @pintobean87 ,

 

Since you are making the sum of the Calendar[Ifwork day] you are getting this circular reference. Believe that the best option in this case is not to have calculated columns but have measures instead, so you should delete this columns and create the relationship and then add the calculations has measures.

 

Be aware that making the shift to measure may require some adjustments to the calculations.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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