Forum Discussion
Cannot create relationships
- Anonymous9 years ago
Hi hidenseek9,
When creating relationship using your sample data, I get the following error message, as the message mentions, one of the columns you use to create relationship must have unique values.
In your scenario, you can remove duplicates(20191666) in your MasterFile as shown in the following screenshot, then create replication between the two tables.
If you want to reserve duplicates in MasterFile, please create another new table using the following DAX(replace table name with your own), then create relationship between the new table and MasterFile, and create relationship between the new table and actual data file.
NewTable = FILTER( DISTINCT( UNION( DISTINCT(Sheet2[#]), DISTINCT(Sheet3[Vendor]) ) ), NOT(ISBLANK(Sheet2[#])) )
Thanks,
Lydia Zhang - Anonymous9 years ago
Hi hidenseek9,
Do you use the "Remove Duplicates" option I mentioned in the second screenshot to remove duplicates? If so, you should be able to create relationship between original tables. "Remove Duplicates" option is available in Query Editor of Power BI Desktop.
Thanks,
Lydia Zhang
Hi hidenseek9,
Do you use the "Remove Duplicates" option I mentioned in the second screenshot to remove duplicates? If so, you should be able to create relationship between original tables. "Remove Duplicates" option is available in Query Editor of Power BI Desktop.
Thanks,
Lydia Zhang
Anonymous
Yes, I used the "Remove Duplicates" option, but the relationship
could not be created.
However, I created a new table, using a combination of
Filter and Distict DAX and I was able to create a relationship.
Thank you for the advice.
I understand now how to use the Filter and Distinct DAX now.
Appreciate your support!
H