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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Circular dependency using Calculate

For a calculation I have created two column measures. The first calculates the # empty values in a row, the second calculates # values in the row that are not labelled as "N/A". However when trying to calculate these two measures at the same time I get an error saying that circular dependency is found. I think the reason is because I do two calculations on the same Table.

 

1st column measure:

empty count = CALCULATE(COUNTROWS(Sorted),Sorted[Value]="")
 
2nd column measure:
totalcount = CALCULATE(COUNTROWS(RELATEDTABLE(Sorted))-CALCULATE(COUNTROWS(Sorted),FILTER(Sorted,Sorted[Value]="N/A")))
 
How do I calculate this without the circular dependency?
 
The background is that I want to calculate these per row for variables in Table A [200 x 200 entries] and to make this calculation in the first place I made a pivot table (called Sorted) to make this calculation in the first place. Using measures (not column measures) I can not visualize it in a table due to the 1:n relationship, resulting in a n : n visualization.
3 REPLIES 3
Anonymous
Not applicable

The easiest way is to make the calculations in Power Query. If you want to remove the circ dep in DAX, avoid CALCULATE, which effects contex transition (placing filters on all columns in the table), and rely only on FILTER.

parry2k
Super User
Super User

@Anonymous it will be easier if you post sample data and expected output and how these tables are related. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Sorry, it took a while to rebuild my .pbix file to allow for posting in this thread.

 

There are two table visualizations in the PBI Dashboard. My goal is to have the 2 columns (Expected Result and Empty Information Fields [Alphabeticaly] in the same visualization and ordered per Variable (1 time per Variable). Now when I add both columns to the same visual the table shows each Variable a number of n times, n being the number of Empty Information Fields.

 

To obtain this I have tried adding colum measure NewTable[empty count] and NewTable[totalcount]. However, having both these measures introduces the circular dependency. 

 

Link to .pbix file 

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.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.