Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Circular Dependency with Date Tables

Hi,

I'm trying to create a couple calculated columns within a date table for use in other tables. Namely, I have an "IsWorkDay" column (boolean) and an "IsHoliday" column (boolean), which is calculated from a linked holiday table. I need an additional column that gives the total work days in a month (the sum of all days that are a work day and not a holiday) for each day because of the relationships I use for the rest of my file, but I'm getting a circular dependency error in my "IsWorkDay" column. If I remove the reference to the "IsHoliday" column in the "IsWorkDay" column, the other calculated columns work fine. This seems off to me because the link to the holiday table should only be used by the IsHoliday column, so I'm not sure where the circular dependency is. I tried reading up on the circular dependency articles linked to throughout the forum, but I'm not quite getting it. I've attached a link to my file for demonstration.

PBIX

11 Replies

  • TeigeGao's avatar
    TeigeGao
    Solution Sage

    Hi Anonymous ,

    It's sorry that I can't open your shared link, could you please share it via other network storage? According to your description, it looks like that your "IsWorkDay" write based on the "IsHoliday".

    Best Regards,

    Teige

    • Anonymous's avatar
      Anonymous
      Not applicable

      TeigeGao 

      Sorry for the bad link, please try this one:

       

      parry2k 

      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?

      • parry2k's avatar
        parry2k
        Super User

        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