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
emma313823
Helper IV
Helper IV

Relationships Issue

Hi All

 

I have an issue which I can't seem to figure out what is causing it.

 

I have pulled in two tables of customer related data of which a common relationship is the part number.  I pulled out a list of part numbers and created a unique table (all duplicates removed), so I can then create a one to many relationships from the unique part number list to the customer list. 

 

When I try to create a relationship from the unique part number talbe to the customer detail table, it tells me I can't create a relationship because I must have unique values and I'm 100% positive my part number table is unique values.  Both tables show the part numbers are set to text also.  Any idea how to fix this?  

 

 

Relationship Issue.png

Emma
1 ACCEPTED SOLUTION

Oops, change COUNTROWS to COUNT.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

18 REPLIES 18
vanessafvg
Super User
Super User

@emma313823 if you removed the duplicates in power query, it sees different cases of  the same value as different values

 

best thing to do is to standardize everything into one case, then remove duplicates

 

however i think null or blank values can also create issues so pad them with a default value like na or unknown





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




The list of unique part numbers is in excel and I used 'get data' for this.  This spreadsheet is updated regularly, so it is easier to have the spreadsheet get updated then refresh the dashboard.

 

 

Emma

When you use Get Data to connect to an Excel sheet you can add a step that removes duplicates. Have you not done this?

 

Seriously try my check. You will see that there are duplicates.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




No didn't know I could do that...I removed duplicates using excel.  I will try this.

Emma

Before you remove duplicates, change the case to upper or lower for the whole column (assuming these "numbers" are actually text value alphanumeric codes rather than literal whole number values).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Greg_Deckler
Super User
Super User

Many times this is caused by capitalization issues.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
KHorseman
Community Champion
Community Champion

Drop your NBO PNs Claimed[Parts Number] column onto a table visual, then add this measure:

 

Duplicate Test = COUNTROWS(NBO PNs Claimed[Parts Number])

 

Sort the table visual in descending numeric order by that measure and you will find something with a result of at least 2.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi - trying to use your suggestions, however it shows the following...any thoughts?  Can't sseem to get it to work

 

syntax error.png

Emma

sorry one more thing...I had to fix what you showed as PARTS NUMBER to Part Number - there was no 's' in part.

Emma

Delete the part that says "Measure = "





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




so sorry for all the questions...I removed measure = and it now shows this...

 

duplicate test issue.png

Emma

Oops, change COUNTROWS to COUNT.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Perfect....thanks so much for your help.  Great trick for my toolbox!

 

Emma

Emma

Glad I could help. How many duplicates did you find? Smiley Happy





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




there were 4.  I'm curious...not sure if you know or not, but if I use the query editor to remove duplicates prior to pulling the data in, why are duplicates still showing?

Emma

Are these text values or real numbers?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I have both source files set to text

Emma

Add a Text.Upper to your import prior to your removal of duplicates.

 

You should also add that to your other table as well so that everything matches.

 

https://msdn.microsoft.com/en-us/library/mt260665.aspx

 

If you right-click the column in Query Editor you will get an option to Transform | UPPERCASE


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.