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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Sorting columns of text

Hi there,

 

New to the forum and also power bi.

 

I am currently trying trouble sorting a column of different text descriptions. The column currently contains phrases such as xxxx completed, completed, delivered xxxx, cancelled,,, xxx cancelled,,, and another 100 or so phrases. That isnt the issue. 

 

What I am wanting to do is generate another column where by if the word cancelled is contained within column 1, in column 2 it just shows cancelled. 

If column 1 contains completed or delivered column 2 then calls it completed.

if column 1 does not contain any of these words then column 2 calls it in progress. 

 

Im trying to crete this column 2 for use in a slicer. So if there is another way of achieving the same outcome, ie. grouping a column of 100 different texts into 3 I am open to suggestions.

 

Thanks in advance people.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

You can use conditional column function in Power Query Editor.

Due to I don't know your data model, I build a sample to have a test.

1.png

Conditioal column function and result,

2.png

You can download the pbix file from this link: Sorting columns of text

 

Best Regards,

Rico Zhou

 

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Hi @Anonymous 

You can use conditional column function in Power Query Editor.

Due to I don't know your data model, I build a sample to have a test.

1.png

Conditioal column function and result,

2.png

You can download the pbix file from this link: Sorting columns of text

 

Best Regards,

Rico Zhou

 

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

AlB
Community Champion
Community Champion

Hi @Anonymous 

This can be best done in Power Query. Please paste some sample data in text-tabular format so that it can be copied

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.