Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Data structure - Many to many relationship requirement?

Hi all

 

Just after some advice for best practice establishing relationships in a PowerBI model.

 

I have a 'Open Cases' table (see below) which is refreshed monthly. I also have a 'Narratives' table (see below) with a many to many relationship as there can be multiple updates on a particular case and if the case is open for multiple months it will appear multiple times on the 'Open Cases' table.

 

Open Cases

 

Reporting MonthCase IDCategoryAssigned toExpected Close
...............

 

 

Narratives

 

IDUpdate DateUpdated byNarrative
............

 

 

This does give me what I need but just want to explore whether there would be a better way to build this relationship.

 

Thanks

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the response.

       

      Just been having a look into bridge tables and looks like an good option. I'm just struggling to rationalise it in my head am i correct in thinking it would be something like this...

       

      Open Cases

       

      Reporting MonthCase IDCategoryAssigned toExpected Close
      1/1/23123AJS31/12/23
      1/1/23124APJ31/10/23
      1/2/23123AJS31/12/23
      1/2/23125BSP31/12/23

       

      Narrative

       

      IDUpdate DateUpdated byNarrative
      1235/1/23AKTest underway
      12328/1/23AKTest completed
      12429/1/23JMInvestigation brief
      12331/1/23AKAssessment write up

       

      Bridge

       

      ID

      123

      124

      125

       

      Hopefully my understanding is correct.... is it in effect checking for unique values in each table listing in the bridge table and allowing a many-to-one relationship from Open Cases to Bridge and Narratives to Bridge?

      • mlsx4's avatar
        mlsx4
        Icon for Memorable Member rankMemorable Member

        Yes, you have done it right. Should work for checking the values!