Forum Discussion

NickProp28's avatar
NickProp28
Post Partisan
5 years ago
Solved

Relationship between tables

Dear Community,

 

I do not have unique values in my table, so I having problem on the link relationship. 

After reading this post, and followed the steps. But still I encounter the same issues. 

(https://docs.microsoft.com/en-us/archive/blogs/cansql/relationships-in-power-bi-fixing-one-of-the-columns-must-have-unique-values-error-message)

 

Kindly take a look on my tables, I have follow the post steps, created "ConsolID" table (remove other column and duplicate value)

 

But still encounter Many - many problem.

 

Please kindly advice and aprreacite any helps.

 

  • Hi, NickProp28 

     

    It’s my pleasure to answer for you.

    According to your description, Many-to-many relationships can easily lead to many problems. Maybe you can create a bridge table and then establish two many-to-one relationships.

    Like this:

     

    Table = DISTINCT(UNION(DISTINCT(Table1[category]),DISTINCT(Table2[category])))

    Reference:Many-to-many relationships in Power BI Desktop - Power BI | Microsoft Docs

    Here is my sample .pbix file.Hope it helps.

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • ConsolId Column of ConsolId table having duplicate values. 

    Please check and remove the duplicates.

    • NickProp28's avatar
      NickProp28
      Post Partisan

      Dear Singaravelu_R ,

       

      As mentioned, I have remove duplicate value when create ConsolID.

      Furthermore, i have copied the ConsolID data and double check on excel. Its show no duplicate value.

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        In the Consollegs table, select Many to One and Single.  Also, when creating the ConsolID Table, ensure that there are no blanks in that table.

  • v-janeyg-msft's avatar
    v-janeyg-msft
    Community Support

    Hi, NickProp28 

     

    It’s my pleasure to answer for you.

    According to your description, Many-to-many relationships can easily lead to many problems. Maybe you can create a bridge table and then establish two many-to-one relationships.

    Like this:

     

    Table = DISTINCT(UNION(DISTINCT(Table1[category]),DISTINCT(Table2[category])))

    Reference:Many-to-many relationships in Power BI Desktop - Power BI | Microsoft Docs

    Here is my sample .pbix file.Hope it helps.

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.