Forum Discussion

DebbieE's avatar
DebbieE
Icon for Community Champion rankCommunity Champion
2 years ago
Solved

Semantic Model load error Name contains a duplicate value

Power Query editor all the data is rfreshing fine.

 

I load into Power BI and get an error

 

Column Name in Table Dim Project contains a duplicate value of 'Name 1'

and this is not allowed for columns on the 1 side of a many to one relationship. Or for columns that are used as the primary key of a table.

 

Project Key   project ID Name             Status

1                   22             Name 1          good

56                 55             Name 1           poor

 

My issue is. That the Name doesnt need to be unique. Its the Project ID that makes it unique

 

In the star schema, I join fact to dim by Project Key to Project Key which is unique

1 (in the dim.  to many in the fact. And again, the Key is unique in Dim. I don't ue Name)

 

In Power Query editor I never use Project Name to merge tables together.

 

Im at a bit of a loss. I don't know how to get past this error.  And I don't think it should be happening. Can anyone give me any advice on what to do next?

 

  • Hi DebbieE ,

     

    Double check if the relationship was done by the correct column, sometimes when dragging and dropping I select the incorrect column by mistake.

     

    A waork around is to remove the relationship, make the Power Query changes and then redo the relationship.

  • From the error, it sounds like you're using Name as a relationship column. Double-check that there aren't any relationships on Name.

     

    If that's not the case, I suppose it's still possible that the Name column got designated as a key column at some point. You can check and set that property with Tabular Editor but I'm not sure that's possible directly in Power BI Desktop.

     

    Properties panel in TE3:

6 Replies

  • From the error, it sounds like you're using Name as a relationship column. Double-check that there aren't any relationships on Name.

     

    If that's not the case, I suppose it's still possible that the Name column got designated as a key column at some point. You can check and set that property with Tabular Editor but I'm not sure that's possible directly in Power BI Desktop.

     

    Properties panel in TE3:

  • Hi DebbieE ,

     

    Double check if the relationship was done by the correct column, sometimes when dragging and dropping I select the incorrect column by mistake.

     

    A waork around is to remove the relationship, make the Power Query changes and then redo the relationship.

    • DebbieE's avatar
      DebbieE
      Icon for Community Champion rankCommunity Champion

      Ill try this one first. 

       

      The relationship is definitely Dim Project Prokect Key (1)  to Project Key  fact (M) so no issues there but I have removed the relationship to try again.

       

      And its still erroring on the issue

       

      then i sarted to think. I have a lot of transformation and landing tables in there (Because I havent managed to use a staging area for this project, Never good I know.

       

      So could it be a staging table linking.....And yep. Power BI had assigned a relationship to the landing table on name that i hadnt seen.

       

      And that resolved it. I hadnt thought about all these hidden tables I have had to have in the model.

       

      Thanks you