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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
BalazsNy
Helper I
Helper I

How to extract text patterns from string value?

Hi all,

 

I have a database with a various length description column, which contains a product ID somewhere in it (even at the beginning, middle or end of the description). These product IDs follow the following pattern: 3 letters + 7 numbers (e.g: ADZ0001234, XET0002341).

 

Do you have any idea, how can I extract these product IDs?

 

Thanks in advance for the tips.

1 ACCEPTED SOLUTION

9 REPLIES 9
Ahmedx
Super User
Super User

Is this what you are looking for?

Screenshot_1.png

Unfortunately, the issue is a bit more complex. You can find my examples replied to your below comment ▼

pls try this

Screenshot_2.png

Dear @Ahmedx!

Thank you very much. Your formula brilliantly works 🙂

BalazsNy
Helper I
Helper I

Thanks for the tips, but I have already tried to solve with these methods, but couldn't figure out a proper formula, because the position of product ID varies field-by-field & non-digit/digit splitting neither worked because sometimes these description fields also contain quarter-related strings like "Q1".

show some example and what result you want

Here are 3 example fields & expected results:

Q3 2022 P&T SI&O MRT ABZ0001235 Monitoring Run Tooling CH --> ABZ0001235
CBR0002134
for PT Development Services 2022 (Q4) -->  CBR0002134 
4 PCS MIDDLEWARE 2022-Q3 --> ""

As you can see, the productID always begins with 3 letters & followed by 7 numbers, which can be anywhere within the string. Sometimes the string doesn't contain any productID, then the result should be empty.

@BalazsNy 

i understand that you dont have  only this pattern ADZ0001234 ?  am  i right ? 

if so, 

can you give some examples of how your productid could be ? 

 

amitchandak
Super User
Super User

@BalazsNy , In power query try split by position

 

https://learn.microsoft.com/en-us/power-query/split-columns-positions

 

Or split by Non Digit to Digit

Split Column By Digit to Non-Digit & Non-Digit to Digit: https://youtu.be/tY4Yk1crS9s

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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