cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dhruvgulati
Helper I
Helper I

remove duplicates words in a row from a column of a string text

input

hello [hello] demo

hi how/how are you

i love you-you

hi how are are you

 

output

hello demo

hi how are you

i love you

hi how are you

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @dhruvgulati ;

You could create a funtion.

 

= Table.AddColumn(#"Changed Type", "Custom", each 
Text.Combine(List.Distinct(Text.SplitAny([name], " -/[]"))," "))

 

The full M language.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WykjNyclXiAZTsQopqbn5SrE6QOFMhYz8cn0gVkgsSlWozC8FC2cq5OSXgbm6MCGISrAquMpYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}}),
    Custom1 = Table.AddColumn(#"Changed Type", "Custom", each 
Text.Combine(List.Distinct(Text.SplitAny([name], " -/[]"))," "))
in
    Custom1

 

The final show:

vyalanwumsft_0-1661155776109.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1660809932391.png

 

AnkitKukreja
Super User
Super User

Hi! @dhruvgulati 

 

For this, you might have to share sample rows. For this, you need to split the columns and then merge to as per your requirement.

 

If I have answered your question or solved your problem, please mark your post as solved.
If you liked my response, please consider giving it a thumbs up

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.