Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Cannot create relationship between two table with primary key in psql

I have three tables, making a many-to-many relationship between products and releases (it is an enterprise solution, and we have releases for the whole package, thats why we have multiple products with the same release). I have a table for products, releases and and association table with two foreign key columns. I have easily made the product - association relationship, but the other is always failing with "You can't create a relationship between these two columns beacouse one of the columns must have unique values.", which is strange as the ID I am connecting with is a primary key in the release table with unique constraint. Can anybody suggest something?

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hello,

     

    It turned out that Power BI is mostly case sensitive (Table.Distinct), except when creating relationships. In that case it is case insensitive, so it will detect duplicated values if, for example, 'Some ID' and 'some id' is present too.

     

    Szabolcs

9 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi Anonymous,

    Right click your table->Edit Query, you will go to Query Editor, click ID column->remove the duplicates as follows, and check if it works fine.



    Best Regards,
    Angelia

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      I have also tried that, and it did not help too. And of course it did not remove any row, as there is a unique constraint on that column in the database. The error still persist :(

       

      Best Regards,

      Szabolcs

      • DAX0110's avatar
        DAX0110
        Resolver V

        Hi Anonymous, you could try checking if the "One side" has any null or blank values?  That could trigger the error you saw.