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
sgross
Helper I
Helper I

"One of the Columns Must Have Unique Values"

I'm getting an error message, but one of the columns definitely does have unique values.

 

In Excel, I've highlighted duplicates, deleted duplicates, changed formatting to catch things that were technically duplicates with dashes in-between the numbers, and deleted duplicates all over again. According to Excel, there are no duplicates left. Not a one. One sheet is all unique values.

 

Any idea why I'd still be getting this error? I've tried everything I can think of. I am bamboozled.

1 ACCEPTED SOLUTION
sgross
Helper I
Helper I

Cracked it!

 

I scrubbed through manually (thankfully it was only a few hundred entries, rather than thousands) and found two entries with unnecessary spaces tacked onto the end - making them technically unique values, invisible to any Remove/Highlight functions!

 

Worth noting that, before I stumbled upon these, I ran a Find and Replace in Excel, attempting to find spaces and replace them with nothing; clicking into the 'find' field, there was already a space in there (from a previous operation, I guess?) meaning I'd accidentally been searching for and trying to replace TWO spaces, rather than one. So, that's why it didn't work!

 

Cheers for your help, everyone!

View solution in original post

10 REPLIES 10
Clinton_Earl
Frequent Visitor

I experienced a similar issue.  I used "remove duplicates" within the query editor but PowerBI still showed the column as "many" when trying to build a relationship between my tables.  I found that one blank row was causing this issue (and it was NOT removed by using "remove duplicates") and was fixed by adding a step to "remove empty" on the field's filter.  Now, works like a charm!  I wish it was more apparent that issue.  Just sharing my thoughts for someone else who may have the same issue.

Anonymous
Not applicable

After a lot of screaming about this myself, I learned some things which I have posted to another thread on the same issue here: https://community.powerbi.com/t5/Desktop/Can-t-create-a-relationship-between-two-columns-because-one...

Diego-mx
Advocate I
Advocate I

This is the most frustrating error EVER!  
I'm getting the same error, and even went to filter the column by "Remove Duplicates" button in the query editor. 
Doesn't fix it.  
I hope someone knows what's going on. 

sgross
Helper I
Helper I

Cracked it!

 

I scrubbed through manually (thankfully it was only a few hundred entries, rather than thousands) and found two entries with unnecessary spaces tacked onto the end - making them technically unique values, invisible to any Remove/Highlight functions!

 

Worth noting that, before I stumbled upon these, I ran a Find and Replace in Excel, attempting to find spaces and replace them with nothing; clicking into the 'find' field, there was already a space in there (from a previous operation, I guess?) meaning I'd accidentally been searching for and trying to replace TWO spaces, rather than one. So, that's why it didn't work!

 

Cheers for your help, everyone!

Glad you got it fixed. You can use the trimming function in the query editor to remove trailing spaces.


@ 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...

I'll be sure to give that a go next time, thank you!

Greg_Deckler
Super User
Super User

Perhaps you have some blanks or something? I would use the "remove duplicates" in the query editor as well as remove errors. Also, use the drop down in the column and look for any wonky values. Also check uppercase/lowercase spelling if it is a text field.


@ 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...

Nope, unfortunately not! Smiley Frustrated

 

No blanks in the unique list (Used 'Remove Empty'), ran 'Remove Duplicates' in Power BI's Query Editor as well as Excel's...

 

Went back into Excel, ensured that all letters (only 'D' and 'T' appear in amongst the numbers) are upper case, and ran 'Remove Duplicates' again... still no joy!

@sgross,

 

Use DAX SUMMARIZE Function to have a check.

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

Also check your case. Excel sees "word", "Word", and "WORD" as duplicates. Power BI's query editor does not, but once you load the query the relationship editor will see them as duplicates.





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

Proud to be a Super User!




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.