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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
RossBateman
Helper I
Helper I

Creating a Relationship Error

I have two tables with an invoice number being the unique field in both. When trying to create it comes up with the error message of ‘You can’t create a relationship between these two columns because one of the columns must have unique values’. 

 

I've removed duplicate rows on both tables but the error message still comes up.

 

Has anyone had this problem before and if so would you be able to help?

 

Many thanks 

1 ACCEPTED SOLUTION

Hi @RossBateman 

As a workaround, If the column has only number type value, you can change its type from "text" to "number",

Capture7.JPG

Then add "prefix",

Capture8.JPG

Then remove duplicates works.

 

Best Regards

Maggie

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

Create a visual table or matrix, take invoice number and again take invoice and change aggregation to count.

Sort desc on Count of Invoice no. Make sure there is nothing having count more than 1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks, it looks like this is the problem. The remove duplicate function doesnt seem to be romoving all of the rows! As I've got over 55k rows do you know of any other ways to delete duplicates?

 

Hi @RossBateman 

As tested, "remove duplicates" works on my side.

Capture7.JPG

Please share some sample data for me to test and find a solution for you.

 

Best Regards

Maggie

Thanks Maggie. The problem was that some of the invoices were different but werent classed as unique when trying to set up the relationship. For example there was invoice number 003 and 0000003. The remove duplicates didnt class those as the same but when not in the query mode they were classed as the same. 

 

The only way I think I can get around this if I add a letter to the begining of every invoice.

Hi @RossBateman 

As a workaround, If the column has only number type value, you can change its type from "text" to "number",

Capture7.JPG

Then add "prefix",

Capture8.JPG

Then remove duplicates works.

 

Best Regards

Maggie

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Need help!

I have the same issue when creating the relationship between the tables. 

I have 3 Facts tables:

Table 1: Have columns of "Acad Session", "Modules" and "hours per week for the module"

Table 2: Have columns of "Acad Session",  "Teaching staff" , and "modules staff are teaching"

Table 3: Have columns of "Acad Session",  "Teaching staff" , and "Status, (Active or Retired)" 

Dimension tables for modules are created by duplicating the Table 1 and keep the column  "Modules" first and then remove the duplicate in the column. But I received the error message "You cann't create a relationship between two columns because one of the columns must have unique values" when trying to create the relationship with Table 1.

Same error for creating Dimension table for "Teaching Staff"

Dimension table for Acad Session and Status have no issue (these two dimension tables have few rows only)

 

Thank you in advance for the advice/help

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors