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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
croberts21
Responsive Resident
Responsive Resident

How to fix "Circular dependency was detected" error

I have PBI Desktop from March 2023.

 

I want to sum Jobcost[actcost] in different ways. To get Postage and Freight I want to sum Jobcost[actcost] where Jobcost[wipcatid] is 10 or 50. To sum "Outside Purchases" I want to sum Jobcost[actcost] where Jobcost[wipcatid] is 1 or 200.

 

My Postage column with a formula works but when I create and enter a formula for my Outside Purch column I get this error: "A circular dependency was detected: Jobcost[Outside Purch], Jobcost[PostFrtCol], Jobcost[Outside Purch]."

 

My postage column: PostFrtCol = CALCULATE(SUM('Jobcost'[actcost]), OR(Jobcost[wipcatid]=10,Jobcost[wipcatid]=50))

My Outside Purch column: Outside Purch = CALCULATE(SUM('Jobcost'[actcost]), OR(Jobcost[wipcatid]=1,Jobcost[wipcatid]=200))

 

Also, the field Jobcost.wipcatid is copied from another table via PowerQuery but resides in the Jobcost table. It seems PBI will not allow me to use both of these at once as columns. I can create one column, but not the other without getting an error. When I create the 2nd column I get the error and I am not sure what is going on.

 

I've also tried tweaking my relationships too but these 2 formulas all use fields from the same table.

 

Can anyone help? Thank you!

 

EDIT: I tried this for outside purchase: 

Outside Purch = (SUMX(FILTER(Jobcost,Jobcost[wipcatltr]="OP"),'Jobcost'[actcost]))
 
but it seems to sum all records in the table, so I have a very large negative number. I also turned off summing for that column in the fields list. 
2 REPLIES 2
Dhairya
Solution Supplier
Solution Supplier

I encountered similar error earlier, please try below mentioned query 

Outside Purch = CALCULATE(SUM('Jobcost'[actcost]), OR(Jobcost[wipcatid]=1,Jobcost[wipcatid]=200), ALLSELECTED([PostFrtCol]))


Please mark my solution as accepted if it works.

I copied and pasted your formula from your answer and I got a circular dependency error. The "ALLSELECTED([PostFrtCol])" should actually be "ALLSELECTED([actcost])".

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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