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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.