cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

How to split column based on first character until first space?

I have a 'Short Description' column that will either start with a '#" character or not AND it may have mulitple '#' in the description.  I need to create a new column for every '#' and keep all of the following characters after the '#' until there is a space.  Therefore, based on the text in the column, the text may NOT need to be split into columns.  The two new columns would be titled "Hashtag 1" and "Hashtag 1 Description."  That means if there is not a '#' as the first character that "Hashtag 1 Description" will be empty.  I would then use the same DAX on the newly created column "Hashtag 1 Description," because there may be multiple "#" in the origianl description, to create two new columns.  Then I plan on doing this one more time to split the column because right now the max is three '#' in the description.  Does anyone have any idea how I can do this?

 

Thanks

 

 

4 REPLIES 4
Super User
Super User

Re: How to split column based on first character until first space?

@TheKiltedGolfer it seems to be doable, if you can share sample data, it will help to get the solution. 






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Re: How to split column based on first character until first space?

Thank you for your assistance.  Below is a sample of my "Short Description" column.  Not sure if it can all be written in one DAX formual or not.

 

STS Sample Snipit.JPG

Super User
Super User

Re: How to split column based on first character until first space?

@TheKiltedGolfer just checking if maximum # can be 3 ?






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Re: How to split column based on first character until first space?

I believe that is correct, up to the date of my reply.  I hope it does not increase to 4 or more but the max number of times a single column should need to be split into individual columns is 3. 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 121 members 1,755 guests
Please welcome our newest community members: