Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Remove duplicates in values (string)

Hello, 

 

I have in a column, values including some duplicates :

 

Ex :

Input :

IDValue
ID1A-B-A-C-A
ID2A-B
ID3A-C-C

 

Expected Output :

 

ID

Value
ID1A-B-C
ID2A-B
ID3A-C

 

Thanks in advance for your help

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Please refer to my pbix file to see if it helps you.

    Create a custom column in Power Query.

    =Text.Combine (
                    List.Distinct(
                              List.Transform (Text.Split([Value],"-"),each Text.Trim(_))
                                      )
                         ,"- ")

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please refer to my pbix file to see if it helps you.

    Create a custom column in Power Query.

    =Text.Combine (
                    List.Distinct(
                              List.Transform (Text.Split([Value],"-"),each Text.Trim(_))
                                      )
                         ,"- ")

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.