Forum Discussion
Circular dependency.....why???
- 2 years ago
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.
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
- lbendlin2 years agoSuper User
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.
- rpinxt2 years agoSolution Sage
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.
- lbendlin2 years agoSuper User
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.