Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
annae
Frequent Visitor

Duplicate Key value in "one to one" relationship tables

Hello everyone!

 

I have two tables with a "one to one" relationship on relationship view. For only one instance, the column with the unique keys (that concatenates a code and a date) appears twice on data view. This is because a similar entry has been made at the same day.

 

Is there any way I can except this particular duplication? Because, otherwise, I change the relationship from "one to one"  to "many to many" and all the RELATED() statements between the table's columns have errors.

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @annae 

If your table1 has duplicate key value, then you can change the relationship to "many to one".

As tested, if you create a column "related(table2[column])" from table2(one side) in table1(many side), it works.

 

Or you can add index column in both table to keep "one to one" relationship as AllisonKennedy suggested.

 

Best Regards

Maggie

AllisonKennedy
Super User
Super User

You could add an index or count to make these values unique or if the data is truly duplicate you could add a remove duplicates step in the Power Query Editor to fix the relationship.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@annae , You can create a step in data transformation to delete duplicate row based on row or column data

https://docs.microsoft.com/en-us/power-bi/desktop-shape-and-combine-data

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.