Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
rashidanwar
Helper III
Helper III

Extract unique words from a text separated by comma

Hi everybody

Hope that you are doing great.

I have a long string containing repetitive words separated by comma. I want to remove the duplicates and retain only unique words.

For example:  John,Arthur,John,Lisa,Patrick,John,Lisa
Output should be: John,Arthur,Lisa,Patrick

I would appreciate for ant help.

Best Regards
Rashid

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @rashidanwar ,

 

You will need to split the columns in to rows first in Power Query Editor and then you could use the below DAX formula to get the result.

Column = CONCATENATEX (
VALUES ( 'Table'[Column1] ),
'Table'[Column1] ,
", "
)

1.PNG

 

Best Regards,
Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @rashidanwar ,

 

You will need to split the columns in to rows first in Power Query Editor and then you could use the below DAX formula to get the result.

Column = CONCATENATEX (
VALUES ( 'Table'[Column1] ),
'Table'[Column1] ,
", "
)

1.PNG

 

Best Regards,
Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Thank you so much for your reply.
This text is the result of a calculated column in the Data view. Doesn't exits in the query editor.

amitchandak
Super User
Super User

@rashidanwar , In power query create a new column like

 

Text.Combine(List.Sort(List.Distinct( Text.Split([Column]))), ",")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

almost 😉

 

Text.Combine(List.Sort(List.Distinct( Text.Split([Column],","))), ",")

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.