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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
WTAS80486
Helper IV
Helper IV

Circular dependency error

Hi,

 

Can anyone help with circular dependency error

 

I have this i 1st measure in 1st table which calculates sum of worked hours  for each month for each person in the 1st table 'labor'

 

Sum of Worked Hours by month = IF(ISBLANK(MINX (labor,labor[Month End date])),0 ,CALCULATE(SUM(labor[Worked Hours]),ALLEXCEPT(laborlabor[Person ID],labor[Month End date])))
 
2nd measure which pulls total hours for each person each month from 2nd table ' hours' column total logged hours
 
Total Hours(Measure) =
VAR _Table =
    FILTER (
        hours,hours[Login ID]=MAX(_labor[Person ID]) &&
        hours[Date]=MAX(labor[Month End date])
           
    )
RETURN
    MINX ( _Tablehours[Total Logged Hours])
 
With the  above two measures i created two calculated columns in 3rd caluated table(monthlysummary) which also pulls in user id  and hierarchy from 3rd table 'user'
 
 "Sum of worked Hours "IF(LOOKUPVALUE(user[User Status  Date], user[Login ID],labort[Person ID]) <= labor[Month End date],[Sum of worked Hours by month],0)
   
      "Total Hours"IF(LOOKUPVALUE(user[User Status Date], user[Login ID],labor[Person ID]) <= labor[Month End date],[Total Hours(Measure)],0)
 
I am using these in the final measure
 
Usage =
CALCULATE (
    (DIVIDE(SUM(monthlysummary[Sum of worked Hours]),SUM(monthlysummary[Total Hours]),0 )))
 
 
here is where i get circular dependency error
2 REPLIES 2
amitchandak
Super User
Super User

@WTAS80486 , Using a measure in a calculated column or calculated table is not a good idea, as those can not take slicer values and are just static calculations.

Better to have measure on top of those measures

 

like

 

Sum of worked Hours  = Sumx(labor,  IF(LOOKUPVALUE(user[User Status  Date], user[Login ID],labort[Person ID]) <= labor[Month End date],[Sum of worked Hours by month],0) )

 

Sumx(labor, IF(LOOKUPVALUE(user[User Status Date], user[Login ID],labor[Person ID]) <= [Month End date],[Total Hours(Measure)],0) )

 

Also Refer: https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak These measures on top of measures are not displaying the correct calculation for worked hours and total hours in the calculated table

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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