cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iingemann
New Member

Grabbing a product number from a cluster of text and then adding it to a new column

Hi, I have received this data set, and I can't seem to wrap my mind around how to extract the value inside the bracket [] (see example below) and add it to a new column.

 

Some points to note. The BB-xxxx phrase I want is always bracketed, and the cell always starts with AA followed by [BB-xxxx]

 

As is  To be  
TextAmount TextNumberAmount
AA [BB-12345] Test184 AA [BB-12345] Test1BB-1234584
AA [BB-123425] Test2834 AA [BB-123425] Test2BB-123425834
AA [BB-1345] Test384 AA [BB-1345] Test3BB-134584
AA [BB-18345] Test483 AA [BB-18345] Test4BB-1834583
AA [BB-912345] Test585 AA [BB-912345] Test5BB-91234585

 

I hope someone is able to help me!

Thanks in advance!

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @iingemann ,

 

Select your [Text] column in Power Query, go to the Add Column Tab > Extract (dropdown) > Text Between Delimiters.

Start Delimiter = [

End Delimiter = ]

 

This should do what you need it to.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @iingemann ,

 

Select your [Text] column in Power Query, go to the Add Column Tab > Extract (dropdown) > Text Between Delimiters.

Start Delimiter = [

End Delimiter = ]

 

This should do what you need it to.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thanks a lot, Pete!

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors