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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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]))), ",")

almost 😉

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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