happyhungarian
Active Member
- Joined
- Jul 19, 2011
- Messages
- 254
- Office Version
- 365
- Platform
- 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"
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"