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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors