Forum Discussion

DineshArivu's avatar
DineshArivu
Helper I
1 year ago
Solved

Remove duplicate names in a same column

Hi Experts,

 

Below the attached table snaps where we can se invoice created date and created by .

Some rows you can see names are repeated even it is same name.

We should showcase only one time a name if it is repeated for multiple times invoice created date (see last 6 rows as a reference)

Invoice created on 2 different dates but both created by same person , so we should not highlight the name 2 times (if different person created then we should display 2 different person names).

 

 

Please help me to achieve this .. If required i can share full M query.

 

Thanks

DK

 

  • dufoq3  thanks for your response , i have fixed this issue by using below query in editor :

    #"Cleaned InvoiceCreatedBy" = Table.TransformColumns(#"Added Custom4", {
    "InvoiceCreatedBy", each
    let
    textValue = Text.Combine(List.Transform(_, Text.From), ","),
    nameList = List.Transform(Text.Split(textValue, ","), Text.Trim),
    uniqueNames = List.Distinct(nameList)
    in
    Text.Combine(uniqueNames, ", "),
    type text
    })
    in
    #"Cleaned InvoiceCreatedBy"

2 Replies

  • dufoq3's avatar
    dufoq3
    Community Champion

    Hi DineshArivu,

    before

     

    after

    let
        Source = Expression.Evaluate("Table.FromRows(List.Transform(Text.Split(""Aug-11-2025,Aug-01-2025;Person A,Person B|Aug-15-2025,Aug-09-2025;Person C,Person C"",""|""), each Text.Split(_, "";"")), {""Invoice Create Date"",""Invoice Created By""})", #shared),
        DistinctCreatedBy = Table.TransformColumns(Source, {"Invoice Created By", each Text.Combine(List.Distinct(Text.Split(_, ",")), ",")})
    in
        DistinctCreatedBy
    • DineshArivu's avatar
      DineshArivu
      Helper I

      dufoq3  thanks for your response , i have fixed this issue by using below query in editor :

      #"Cleaned InvoiceCreatedBy" = Table.TransformColumns(#"Added Custom4", {
      "InvoiceCreatedBy", each
      let
      textValue = Text.Combine(List.Transform(_, Text.From), ","),
      nameList = List.Transform(Text.Split(textValue, ","), Text.Trim),
      uniqueNames = List.Distinct(nameList)
      in
      Text.Combine(uniqueNames, ", "),
      type text
      })
      in
      #"Cleaned InvoiceCreatedBy"