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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.