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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Charuta
Frequent Visitor

Circular Dependency Error for Calculate

Hello All,

Need help to fix circular dependency in order to get the final date

In calculations, need to average and then find how much time is required for completion based on last 2 months average.

 

Columns - Status ( there are 2 status - completed and pending) ,project, points, closingdate, work_left

[points] are at [mainkey_id] level and rolled up to project level

work_left is sum of points at [mainkey_id] level with [status] as pending 

DateDim is calculatedtable having all dates and joined with closingdate from Query1

 

based on completed status for last 2 months we add the points per project and take an average.

 

[AvgWorkDone] =

IF(ISBLANK(CALCULATE(SUM('Query1'[points]),DATESBETWEEN(DateDim[Date],TODAY()-60, TODAY()) , ALLEXCEPT('Query1','Query1'[mainkey_id]))/2 ),0,CALCULATE(SUM('Query1'[points]),DATESBETWEEN(DateDim[Date],TODAY()-60, TODAY()) , ALLEXCEPT('Query1','Query1'[mainkey_id]))/2 )

 

The report has to show all data so we have data pulled for last 2 years and for computing final date we need to consider only last 2 months average.

we get the correct average and even if we take the ratio of this average based on the work pending we get the right result in a measure. Calculated Column does not show the right result.

This still works fine, but the calculated number of days are to be added in today's date so using DateAdd get circular dependency. Tried using ALLEXCEPT but nothing works.. 

 

to calculate the final date --- 

CALCULATE
(

DATEADD(
Query1[DateToday],
DIVIDE(
SUM(Query1[work_left]),
CALCULATE(SUM(Query1[AvgWorkDone]),ALLEXCEPT(Query1,Query1[mainkey_id]))
,0)
,DAY)
,ALLEXCEPT(Query1,Query1[[mainkey_id])

 

not sure what needs to be changed or calculated differently. Any help much appreciated

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

If possible, push the calculated columns computation further upstream (into Power Query or the data source). That will avoid the circular reference issue.

 

Same for the DateDim - don't do that in DAX, do it in Power Query or further upstream.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

If possible, push the calculated columns computation further upstream (into Power Query or the data source). That will avoid the circular reference issue.

 

Same for the DateDim - don't do that in DAX, do it in Power Query or further upstream.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.