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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ryan_b_fiting
Post Patron
Post Patron

Search text field with Wildcard

Hello Community - 

 

I am looking for some help when searching a text field.  I am trying to use an IF formula to search the text field that contains certain strings.  For the most part this works, but my issue is there I need to be able to search for a string "light - N Ounces" where N could be any number of ounces between 1 and 164.  I cannot seach for 'light' only, because that string occurs within other areas in the text field.  But I need the 'light' to be immediately followed by the 'N ounces' text string to categorize it.

 

I am using the CONTAINSTRING function in my current formula as I am looking for other keywords already, but I cannot figure out how to identify a string that has a changing value within it.

 

Any help would be greatly appreciated.

Thank You

Ryan Fiting

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

Hi @ryan_b_fiting ,

Contains = IF(CONTAINSSTRING(max(stringSearch[Column1]),"light - *ounces"),"Yes", "NO")


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Nathaniel_C
Super User
Super User

Hi @ryan_b_fiting ,

Glad this worked for you!

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Nathaniel_C
Super User
Super User

Hi @ryan_b_fiting ,

Contains = IF(CONTAINSSTRING(max(stringSearch[Column1]),"light - *ounces"),"Yes", "NO")


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ryan_b_fiting , as you can see, using the wildcard "*" works.

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

Nathaniel_C_0-1653936031876.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




tamerj1
Super User
Super User

Hi @ryan_b_fiting 

please provide some examples 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.