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.
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.
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.
- parry2k7 years ago
Super User
Anonymous ok, I didn't looked at your file yet thou. I'm wondering why not you merge both tables in PowerQuery and then IsHoliday just part of date table.
- Anonymous7 years agoNot applicable
If I merged them, how would that look? The holiday table is just a 2-column table with a few lines that show our company's holiday schedule, whereas my date table is a whole bunch of columns with month number, month name, quarter, etc.