Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Remove duplicates but keep nulls

I am having an issue while attempting to remove duplicates but keeping nulls. The ID column has both duplicates and nulls. I need to remove the duplicate values but keep the null IDs. I am trying to ...
  • dufoq3's avatar
    dufoq3
    1 year ago
    let
        Source = Table.Combine({Master, Budget}),
        ChangedType = Table.TransformColumnTypes(Source,{{"ID", type text}}),
        GroupedRows = Table.Group(ChangedType, {"ID"}, {{"T", each if [ID]{0} = null then _ else Table.FirstN(_, 1), type table}}),
        CombinedT = Table.Combine(GroupedRows[T])
    in
        CombinedT