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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Identify text contains Alphabets&Number

Hello everyone,

 

Can you please help to advise, in power query, how to identify specific format of text?

Here is sample file for download.

 

After loading data, we would like to add one more column, called "Search Type".

If a Query contains either of following format text, set the value to "Product Search" in the new added Column, otherwise, set value to "non-Product Search":

 - 1 digit alphabet followed by 2-4 digits numbers, or

 - 2-3 digits numbers followed by 1-6 digits alphabets, or

 - 1-3 digits numbers followed by a "-" dash followed by 5-7 digits numbers or/and alphabets, or

 - "Nikon" or "Canon" or "Alienware" contained

h_l_1-1636410358200.png

h_l_2-1636410440532.png

 

Your inputs are appreciat3ed.

Thank you.

H

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

Can you change your mind and look for "non-Product Search" with search term and "Product Search" for others?

vjaneygmsft_0-1636619850117.png

If you agree with what I said, then you can create a column.

Like this:

Column = 
 IF(SEARCH("Search Term",[Query],1,-1)>0,"non-Product Search","Product Search")

vjaneygmsft_1-1636624333129.png

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If problem still persists, pls let me know.

 

Best Regards,
Community Support Team _ Janey

 

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

Can you change your mind and look for "non-Product Search" with search term and "Product Search" for others?

vjaneygmsft_0-1636619850117.png

If you agree with what I said, then you can create a column.

Like this:

Column = 
 IF(SEARCH("Search Term",[Query],1,-1)>0,"non-Product Search","Product Search")

vjaneygmsft_1-1636624333129.png

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If problem still persists, pls let me know.

 

Best Regards,
Community Support Team _ Janey

 

mahoneypat
Microsoft Employee
Microsoft Employee

This is a job for RegEx, which is not natively supported in Power BI.  However, this article describes a hack to do it.  It is also possible with R or Python.

Power Query Regular Expression Hack | Math Encounters Blog (mathscinotes.com)

 

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


Anonymous
Not applicable

Thank you for reply @mahoneypat , I will try to look into it although not a programmer 😉

Have a good day!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors