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
jagostinhoCT
Post Partisan
Post Partisan

Circular Reference in COUNTA

Hello,

 

I have a column filled with values of 2 types "Dated" and "Recent"

Skills[Review Status]

 

the following is working

Reviews Total Dated = CALCULATE(COUNTA(Skills[Review Status]),Skills[Review Status]="Dated")

 

I wanted to create another calculated column for the Recent values

Reviews Total Recent = CALCULATE(COUNTA(Skills[Review Status]),Skills[Review Status]="Recent")

 

But it returns the error

"A circular dependency was detected: Skills[Reviews Total Recent], Skills[Reviews Total Dated], Skills[Reviews Total Recent]."

 

Why is this happening and how can I fix it? And hopefully how to learn not to do it wrong next time?

 

Thank you

1 ACCEPTED SOLUTION
kcantor
Community Champion
Community Champion

@jagostinhoCT

Perhaps you should change it slightly.

Total Reviews = COUNTA(Skills[Review Status])

Reviews Total Dated = CALCULATE([Total Reviews], Skills[Review Status] = "Dated")

Reviews Total Recent =CALCULATE([Total Reviews], Skills[Review Status] = "Recent")

That way you are building on the first measure by filtering instead of doing different measures.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
kcantor
Community Champion
Community Champion

@jagostinhoCT

Perhaps you should change it slightly.

Total Reviews = COUNTA(Skills[Review Status])

Reviews Total Dated = CALCULATE([Total Reviews], Skills[Review Status] = "Dated")

Reviews Total Recent =CALCULATE([Total Reviews], Skills[Review Status] = "Recent")

That way you are building on the first measure by filtering instead of doing different measures.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




wonga
Continued Contributor
Continued Contributor

@jagostinhoCT

 

This should work, because I have a similar situation and I don't get that error.

 

Usually a "circular dependency" means you are referencing something that you are trying to change.

 

Are you sure you should be using a calculated column for this? Wouldn't a measure be more appropriate since it's returning a number?

 

In my case, I have them both as measures and NOT calculated columns.

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.