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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amikm
Helper V
Helper V

Getting circular dependency error while creating calculated column

Hi,

 

I have a measure in my Sales table :

WW_Anchor_R6Sales:=
var R6Sales=CALCULATE([MeasureR6Sales]>0, FILTER(Product,Product[Program] = "WW"
&& Product[Anchor] = "Y"))

return
IF(ISBLANK(R6Sales),0,R6Sales)

 

LY_Anchor_R6Sales:=
var R6Sales=CALCULATE([MeasureR6Sales]>0, FILTER(Product,Product[Program] = "LY"
&& Product[Anchor] = "Y"))

return
IF(ISBLANK(R6Sales),0,R6Sales)



MeasureR6Sales:=
var salesR6=CALCULATE(SUM(Sales[SalesAmount]),FILTER(Sales,Sales[InvoiceDate]>=EDATE([LastClosedMonth],-5) && Sales[InvoiceDate]<=[LastClosedMonth] && Sales[SalesAmount]>0))
return IF(ISBLANK(salesR6),0,salesR6)

 

When I have created a calculated column:

WW_Anchor_R6:= IF([WW_Anchor_R6Sales]>0,"Yes","No")


I am able to create, but when I am trying to create another calculated column say:

CalculatedColumn1:= IF([LY_Anchor_R6Sales]>0, "Yes", "No"), it is giving me an error saying that

 

Failed to save modifications to the server. Error returned: 'A circular dependency was detected: Sales[Calculated Column 1], Sales[WW_Anchor_R6], Sales[Calculated Column 1].

 

How to fix this error?

 

4 REPLIES 4
v-angzheng-msft
Community Support
Community Support

HI, @amikm 

 

It may be helpful if you create a copy of the table or to summarize a new table.

amikm
Helper V
Helper V

Any update

PaulDBrown
Community Champion
Community Champion

This video from the gurus at sqlbi.com will help you solve the issue:





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown ,

 

I have followed his videos, I am able to understand the reasons for circular dependency, but when I am trying to implement ALLEXCEPT in my use case, It is not allowing me to do so, I am getting another error related to ALLEXECPT. In my use case, I am using Measure then I am using the measure result to calculate my columns with IF condition.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.