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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
RingoSun
Helper II
Helper II

Splitting a text in a column

Inside a column I have values such as:

Column

Test Nice Product

Test 1 Product
Test 2 Good Product
Test 3 Product

I want to do the splitting inside the same column (I don't want new columns to be created) so it should look like this

Column
Test
Test 1
Test 2
Test 3

 

In other words, I want the words after Test to be excluded. How do I do that?

1 ACCEPTED SOLUTION
mahenkj2
Solution Sage
Solution Sage

I have tried to use certain transfomations in Power query, Please let me know if this is what you are looking for.

 

I will try to explain the working later:

 

https://drive.google.com/file/d/1oweJyDKNJ5JqK6UNTIrWxPRCUhyb7fFX/view?usp=sharing

 

View solution in original post

6 REPLIES 6
mahenkj2
Solution Sage
Solution Sage

I have tried to use certain transfomations in Power query, Please let me know if this is what you are looking for.

 

I will try to explain the working later:

 

https://drive.google.com/file/d/1oweJyDKNJ5JqK6UNTIrWxPRCUhyb7fFX/view?usp=sharing

 

Hello @RingoSun

Though, I have attached a sample file for you as an example, it really also depends how your column data looks like. If there is certainty that there shall be some numbers after which you finally want to split, and only after second space you need this split (first split is between the 'Test' and numbers), then this sample file should be showing exactly that.

If your data has some other behavior, even then it should be possible to undertstand the possibilities of Power query for all those varying needs.

 

So what I did here:

1. Split the column at left most delimiter, i.e. a space here.

2. Split the second column again at left most delimiter i.e.a space.

3. The way your data is, first record is Test without a number, but other record have numbers. So column generated in step 2 above have text as well as numbers. We need to repace text in this column with blank. So I used Text.Select function.

4. Finally merged 2 columns of interest and removed unnecessary columns.

 

If any questions, please do let us know.

 

jaipal
Resolver III
Resolver III

@RingoSun there are multiple ways to do it. One of them is as follows

jaipal_0-1651718630300.png

 

@jaipal 

I've been trying to experiment with that option but I just cant seem to get my desired output

@RingoSun because rows has data with many spaces. You can try @Ashish_Mathur 's solution or you can try with DAX something like:

column= Left/right('table[column]', 6]   

 

 

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, select this column and click on Replace Values.  Find for  Product i.e. space and Product.  Click on Replace.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

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

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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