Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
So I have this calculated column returning a nummber :
Solved! Go to Solution.
Your calendar table is derived from your fact table. That is akin to using CALENDARAUTO, and is Very Bad Indeed.
Overcome the urge to create calendar scripts in DAX or Power Query. They are useless. Use an external reference table.
You also don't need to specify table names in calculated columns.
A circular dependency error typically occurs when a calculated column references another calculated column which in turn references the original column, creating a loop. In your case, the Timing calculated column references the HourDiff calculated column, which itself references other columns in the table, including SC2[DT311].
To avoid the circular dependency, you can rewrite the Timing column without directly referencing the HourDiff column. Here's a modified version:
In this version, we're using the CALCULATE function to evaluate the maximum value of the HourDiff column within the current context. This avoids the circular reference issue, allowing you to determine whether the value exceeds 24 and return "Late" or "On Time" accordingly.
Ok officially am losing my mind now 😂
So this was the logic in field 'Timer' that led to the circular:
@lbendlinoohhh now I see what changed in your version :
This was :
You started at February so it could not see a weekend marker for January data so that is why your measure did show 0 for weekend in January.
But the determination of the max and min date than are the cause of the circular dependancy?
That would be strange.
When two tables depend on each other you always get a circular dependency. Nothing strange here.
Well I did my MAX and MIN in the sample file and the weekends where good again and no circular in the sample file....
But now I saw this :
In the sample file the Timing calculated column has an fx sign.
In the original :
There is is a sigma sign....
So how did you get that fx sign in the sample file @lbendlin ?
Hello @lbendlin and others.
I uploaded the pbix file to google drive.
This link should be public. Please let me know if not :
https://drive.google.com/file/d/1WNe7cZKkOawjx8RzxxfdKiGGVmUGkJHr/view?usp=sharing
So the problem is with the calculated colun 'Timing' in table SC2
Your calendar table is derived from your fact table. That is akin to using CALENDARAUTO, and is Very Bad Indeed.
Overcome the urge to create calendar scripts in DAX or Power Query. They are useless. Use an external reference table.
You also don't need to specify table names in calculated columns.
Thanks @lbendlin , so autocalendar or calendar tables based on your source data are a bad idea?
What would you mean with an external reference table? Like an excel file with all dates of the last 5 years for example?
But if I understand correctly and looking at what you changed the field 'weekendcorrection' was the cause of the circular?
Your solution indeed does not lead to a circular dependency but it seems not to be correct:
First line in is 5 Jan 24 and 8 Jan 24. That was a Friday and a Monday so there was a weekend on that line.
You logic returns 0 hours there instead of 48. So that is not correct.
Is there something we can change in the logic to make it work (and not get a circular again)?
ps: thanks for pointing out that you don't need to specify table names in calculated columns.
Yes, an Excel file on a SharePoint will be good.
Sorry about messing with the formula. I didn't understand what you were trying to do there. Most likely not needed anyway as you can mark weekends and holidays in the calendar table.
Well I had a weekend "mark" in my autocalendar:
Yeah, weird. You can avoid it by re-implementing the calculation rather than referencing it.
You mean like putting the initial calculation in a VAR @lbendlin ?
Tried it (also changed my initial calculation but still no luck) but also does not work:
So I now made a column WeekendCorrection which returns 0 or 48.
But as you can see it still sees a circular dependency and I have no clue why....
Also why is it naming SC2[HourDiff]? That field is not involved in these calculations.
var _HourDiff is and not the original [HourDiff].
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |