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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.