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
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
v-rzhou-msft
Community Support
Community Support

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
v-rzhou-msft
Community Support
Community Support

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

v-rzhou-msft
Community Support
Community Support

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
Super User
Super User

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
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.