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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pedroccamara
Helper II
Helper II

How to search for a string of characters

Hello everyone

Is there a way of searching a person's name, for example, in the whole table and whole fields? How?

Best regards

Pedro

3 ACCEPTED SOLUTIONS
ImkeF
Super User
Super User

Yes, you can use Table.FindText: https://msdn.microsoft.com/en-us/library/mt260782.aspx

this will return the row where the text is found

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

Sure. Check out this video and come back if there is anything else that can help:

https://youtu.be/QGhULCWvySM

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

Hi @pedroccamara,

 

In addition to ImkeF's solution, you can also use SEARCH Function (DAX) to create a calculate column within Modeling tab in this scenario. See my sample below.

 

Assume we have a table called "MyTestTable" like below.

t1.PNG

1. Use the formula below to create a calculate column called "NameContainsBob" in "MyTestTable".

NameContainsBob = IF ( ISERROR ( SEARCH ( "Bob", MyTestTable[Name] ) ), "Other", "Bob" )

cc1.PNG

2. Then you should be able to use "NameContainsBob" column as a Slicer and show the data you want in the report.

result.PNG

Here is the sample pbix file for your reference.

 

Regards

View solution in original post

5 REPLIES 5
ImkeF
Super User
Super User

Yes, you can use Table.FindText: https://msdn.microsoft.com/en-us/library/mt260782.aspx

this will return the row where the text is found

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hello Imkef

Many thanks for your reply

 

Please can you be more specific?

 

Where can i use it and how? Is it in editor mode or...? Can i choose some kind of visualizations?

Can you help me please, cose it's a procedure that i'm doing too many times in a day...

 

Tks a lot

Best regards

Pedro

Hi @pedroccamara,

 

In addition to ImkeF's solution, you can also use SEARCH Function (DAX) to create a calculate column within Modeling tab in this scenario. See my sample below.

 

Assume we have a table called "MyTestTable" like below.

t1.PNG

1. Use the formula below to create a calculate column called "NameContainsBob" in "MyTestTable".

NameContainsBob = IF ( ISERROR ( SEARCH ( "Bob", MyTestTable[Name] ) ), "Other", "Bob" )

cc1.PNG

2. Then you should be able to use "NameContainsBob" column as a Slicer and show the data you want in the report.

result.PNG

Here is the sample pbix file for your reference.

 

Regards

Hello ImkeF and JerryLi

 

I'm so lucky for this solution you've show me.

Gotta test them both monday. 

you're both awesome!

Tks a lot

Best regards

Pedro

Sure. Check out this video and come back if there is anything else that can help:

https://youtu.be/QGhULCWvySM

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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