Forum Discussion
Circular Dependency with Date Tables
- 7 years ago
Anonymous attached. I added two columns in PowerQuery, feel free to change as per your need.
Sorry for the bad link, please try this one:
I have read through the two articles you shared and I believe I understand the gist of what they're saying. Given what I'm trying to accomplish in my model, can you recommend a workaround for the circular dependency?
Anonymous not sure why need IsHoliday column, if you are adding that just for calculating IsWorkDay then you can get rid of IsHoliday column and add the same logic in IsWorkDay Column.
In case you need IsHoliday column then use same logic in IsWorkDay column instead of referring to IsHoliday
- Anonymous7 years agoNot applicable
I need the IsHoliday column because I'm going to use that in a measure in my fact table, and I need the IsWorkDay for a calculated column in this date table. To give the full picture, my fact table has all of my data on a monthly basis, but I force the dates in that table to the first of every month so that I can still link all of my dimensions to the date table and filter on a monthly basis through that. That being the case, I use calculations to sum up the number of total days and working days (i.e., non weekends/non holidays) for measures in my fact table. I need the total days in a month and working days in a month in a column for each day so that data is captured on each row in the date table because of the fact that all my fact table dates fall on x/1/2019.
Also, I tried copying the logic of IsHoliday into IsWorkingDay to avoid the reference but I'm still getting the circular dependency.
There's probably a more elegant way to do what I'm trying to do, but the model I have has worked up to this point until I realized that I am double counting holidays that land on weekends in some of my calculations.
- parry2k7 years ago
Super User
Anonymous well if you need both column I mentioned that you use same IsHoliday logic in IsWorkingDay instead of using IsHoliday column in IsWorkignDay?
Did you tried this? Let's focus on this if this get solved then talk on next steps. I like to break things into smaller pieces.
- Anonymous7 years agoNot applicable
Yes, I tried copying the formula of IsHoliday into IsWorkingDay and it still gave me the error.