cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
EML_7
Helper III
Helper III

Circular Dependency

Hi, 

I have two measures: 

 

Measure One:

Total_mort_a =

Calculate(

Sum( 'comps'[comp_value]),

'comps'[mort_id] in {"A"})

 

Measure Two:

 

Total_mort_d =

 

Calculate(

 

Sum( 'comps'[comp_value]),

 

'comps'[mort_id] in {"D"})

 

I have then created a column (as I need to SUM this later) with the following logic:

 

Exclusion_for_mort_a =

If('comps'[comp_exclude_flag] ="Yes",'comps'[Total_mort_a],

If('comps'[app_exlude_flag] ="Yes",'comps'[Total_mort_a],

If('comps'[fa_exlude_flag] ="Yes",'comps'[Total_mort_a],0)))

 

All of the above so far, works perfectly.

 

I have then tried to replicate the same logic for Exclusion_for_mort_a but this time, for the Measure total_mort_d

 

Exclusion_for_mort_d=

 

If('comps'[comp_exclude_flag] ="Yes",'comps'[Total_mort_d],

 

If('comps'[app_exlude_flag] ="Yes",'comps'[Total_mort_d],

 

If('comps'[fa_exlude_flag] ="Yes",'comps'[Total_mort_d],0)))

 

 

But for this Measure, I get the error message:

Circular dependency comps[column], comps[Total_mort_a], comps[column]

 

I'm really confused as to why this is a problem as I have 2 separate measures for mort_a and mort_d.

Can anyone please point me in the right direction as to how I resolve this please? 

1 REPLY 1
HotChilli
Super User
Super User

The first thing to do is to rewrite the calculated column so that it doesn't use measures.  I see people doing this all the time and it's not a good idea.

You may still experience a circular dependency after this but you will be able to track why it's happening

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors