Remove Duplicates Issue

happyhungarian

Active Member
Joined
Jul 19, 2011
Messages
254
Office Version
  1. 365
Platform
  1. Windows
Hi All, I'm running the following power query but the results are leaving a few duplicate "Unique ID"s. Can you tell me where I am going wrong with this? What I was hoping it would do is first filter out any records where the "Total" was not >=0 and then, with the remaining records, filter out any duplicate Unique IDs (even if the duplicate Unique ID had a different "Total". Hope that makes sense.

let
Source = Excel.CurrentWorkbook(){[Name="Prior"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Status", type text}, {"Company", type text}, {"Customer", type text}, {"Total", type number}, {"Unique ID", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Status", "Company", "Customer"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each [Total] >= 0),
#"Removed Duplicates" = Table.Distinct(#"Filtered Rows", {"Unique ID"})
in
#"Removed Duplicates"
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Are there any spaces that maybe you can't see? Maybe use the Text.Trim function
 
Upvote 0
I did notice that the duplicate records had different capitalization of letters but when I do "Record"="Record" i get a "True" answer. I wouldn't think that Remove Duplicates would take capitalization into account but maybe that's it?
 
Upvote 0
Yes that it is it. use the function Text.Upper or Text.Lower and then remove duplicates
 
Upvote 0
Solution

Forum statistics

Threads
1,224,922
Messages
6,181,783
Members
453,065
Latest member
jfrsanders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top