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
BI-1294
Frequent Visitor

Remove duplicates doesn't work

Hi all,

I'm facing a very common problem regarding the remove duplicates function in power query. If I try to remove duplicates from the column "username", not all the duplicates are removed (Link for the csv file - open in with Firefox)

I've tried using trim, clean, remove blanks, remove errors transformations before doing the eliminate duplicates, but it doesn't work.

 

Is there anyone you can help me?

In this moment I fixed the problem via dax, but I would prefer to do it in power query and not in dax.

 

Thanks a lot for your help

1 ACCEPTED SOLUTION

Looking at your data, these rows aren't duplicates since Power Query is case-sensitive.

AlexisOlson_0-1633710234673.png

 

If you want these to be considered the same, I'd recommend adding a step to transform to all lowercase before removing duplicates.

View solution in original post

8 REPLIES 8
AlexisOlson
Super User
Super User

Can you share the M code you are using (you can grab it from the Advanced Editor)?

Yes, of course. Here below the M code.

BI1294_0-1633706544570.png

An example of user that this code can't remove is "Jvn_91" and I couldn't figure it out why.

BI1294_1-1633706658818.png

 

 

Hmm. That's pretty odd. Any chance you can share the CSV or an edited version of it so we can try to reproduce your result?

 

On the off-chance this is just a caching thing, I recommend hitting Refresh Preview again.

I just tried to hit Refresh Preview, but it doesn't work. That's really strange because it always worked in the past.

Here there is the csv file (Link for the csv file - open it with Firefox because the other browers can't open it)

Looking at your data, these rows aren't duplicates since Power Query is case-sensitive.

AlexisOlson_0-1633710234673.png

 

If you want these to be considered the same, I'd recommend adding a step to transform to all lowercase before removing duplicates.

Actually, I don't see the difference "j" in this case. If I see my data they are both capitalized. How do you see them differently from me?

 

BI1294_0-1633716576047.png

 

Here there is another example:

BI1294_0-1633716910292.png

 

You are looking at the table in the Data pane rather than the query editor like I was.

 

I'm guessing the engine selected a single representation to show since DAX doesn't inherently distinguish case like M does.

Thanks a lot, I didn't notice that the two have different initials 😅

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.

Top Solution Authors
Top Kudoed Authors