Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

How to avoid circular reference, simple case

Hi, 

 

I have a very simple scenario, 2 tables in relation between them that both have a date field.

I need to apply a date filter to both, but I can't connect them via a relationship, otherwise I get a circular dependency

 

How can I avoid that?

 

TIA 

  • Hi Anonymous , Thank you for reaching out to the Microsoft Community Forum.

     

    Create a separate Date table in your model. Make sure both tables have a proper date column for SalesAssignments, convert the period text (like JAN 2025) into an actual date, such as the first day of the month. You can do this in Power Query using basic date transformation steps.

     

    Once both tables have valid date columns, go to the model view and create relationships from each of them to the Date table. Do not connect the two fact tables to each other. As long as both link to the Date table, the slicer will filter them correctly.

7 Replies

  • remove the relationship between the taables in the bottom

     

    you only need the 2 relationship starting from the the date table

     

    If this helped, please consider giving kudos and mark as a solution

    me in replies or I'll lose your thread

    consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

    • Anonymous's avatar
      Anonymous
      Not applicable

      But I need to show (for example) which customers where reached by sales reps in a specific time frame. If the user selects "january" my dashboard will show that john has reached only cust 1 but not cust 4,

      I assume I need a relationship between the tables. 

  • Hi Anonymous 

     

     You could merge the 2 tables on customer ID to avoid this issue. Is that an option for you?

     

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Anonymous , Thank you for reaching out to the Microsoft Community Forum.

     

    Create a separate Date table in your model. Make sure both tables have a proper date column for SalesAssignments, convert the period text (like JAN 2025) into an actual date, such as the first day of the month. You can do this in Power Query using basic date transformation steps.

     

    Once both tables have valid date columns, go to the model view and create relationships from each of them to the Date table. Do not connect the two fact tables to each other. As long as both link to the Date table, the slicer will filter them correctly.

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Anonymous , hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Anonymous , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi Anonymous , Hope you're doing fine. Can you confirm if the problem is solved or still persists? Sharing your details will help others in the community.