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
johndolan2
Resolver I
Resolver I

Split column by Nth character into rows

Hi - I have not been able to find an answer and am looking for some help. I need to split a column after every 3d space and have these split into new rows … not new columns. Any help would be appreciated. I have pbix file as an example. Thanks, John
3 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

Please post a link to your pbix file. This should be doable with List functions in power query. You could split your text string at every space with Text.Split, then group those into a list of 3 element lists with List.Split, and then use List.Transform with Text.Combine on each sublist concatenated with spaces to get your desired List. You can then "Expand to New Row" to get your desired result.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-stephen-msft
Community Support
Community Support

Hi @johndolan2 ,

 

You did not upload your file. And it's about spliting column by Nth character into rows.

vstephenmsft_0-1643162165395.png

4.png

 

Best Regards,

Stephen Tao

 

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

Pat - I flat out CANNOT THANK YOU ENOUGH!!!!!!!! I spent a frustrating number of hours over a stretch of weeks attempting to do this and you had it figured out in seconds. For anyone else reading this .... My situation was that I had a column in which each cell contained multiple entries seperated by spaces. I could not use the available split by delimiter since the number of characters varied. For example: 123 abc pair1 456 bcd pair 12 was in a single cell. I needed to have 123 abc pair 1 split into its own row and 456 bcd Pair 12 into it's own row. I have a column with hundreds of these and each row incldudes any where from a single entry (abc 123 pair 2) upwards to 12 .. and they were of various lengths.  .... Also, Pat's got a great YouTube channel .... 

 

I cannot possibly say thank you enough. 

 

John

Pat - You have a great YouTube channel

View solution in original post

4 REPLIES 4
v-stephen-msft
Community Support
Community Support

Hi @johndolan2 ,

 

You did not upload your file. And it's about spliting column by Nth character into rows.

vstephenmsft_0-1643162165395.png

4.png

 

Best Regards,

Stephen Tao

 

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

 

Thankyou Stephen. I had not clearly stated my problem. .. which was the # of spaces varied. Pat Mahoney came up with the solution to my particular situation. .....Thank you very much Stephen and it's on me for not clearly stating my problem - So again I really apprecaite the reply. John

mahoneypat
Employee
Employee

Please post a link to your pbix file. This should be doable with List functions in power query. You could split your text string at every space with Text.Split, then group those into a list of 3 element lists with List.Split, and then use List.Transform with Text.Combine on each sublist concatenated with spaces to get your desired List. You can then "Expand to New Row" to get your desired result.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Pat - I flat out CANNOT THANK YOU ENOUGH!!!!!!!! I spent a frustrating number of hours over a stretch of weeks attempting to do this and you had it figured out in seconds. For anyone else reading this .... My situation was that I had a column in which each cell contained multiple entries seperated by spaces. I could not use the available split by delimiter since the number of characters varied. For example: 123 abc pair1 456 bcd pair 12 was in a single cell. I needed to have 123 abc pair 1 split into its own row and 456 bcd Pair 12 into it's own row. I have a column with hundreds of these and each row incldudes any where from a single entry (abc 123 pair 2) upwards to 12 .. and they were of various lengths.  .... Also, Pat's got a great YouTube channel .... 

 

I cannot possibly say thank you enough. 

 

John

Pat - You have a great YouTube channel

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.

Top Solution Authors
Top Kudoed Authors