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
Anonymous
Not applicable

search

Hi,

What does this dax do please?

SEARCH("SP*",[fieldname],1,0) > 0

 

Thanks

1 ACCEPTED SOLUTION

hi, @Anonymous  

As the document said, 

Term Definition
find_text The text that you want to find.

You can use wildcard characters — the question mark (?) and asterisk (*) — in find_text. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

 

https://docs.microsoft.com/en-us/dax/search-function-dax

 

This formul  SEARCH("SP*",[fieldname],1,0) > 0 equals SEARCH("SP",[fieldname],1,0) > 0

It returns that if there is "SP" in the field, it will return ture.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
tex628
Community Champion
Community Champion

It searches the field "Fieldname" for the textstring "SP*" and if it finds it, it returns the index otherwise a 0. 

https://docs.microsoft.com/en-us/dax/search-function-dax


Connect on LinkedIn
Anonymous
Not applicable

Hi,

I investigated further, it looks to find any text that begins with SP, rather than SP*

i.e. it returns sp1, sphello


, etc.
But how can I check for string that begins with SP* and do not want to use * as wild card

Thank you

hi, @Anonymous  

As the document said, 

Term Definition
find_text The text that you want to find.

You can use wildcard characters — the question mark (?) and asterisk (*) — in find_text. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

 

https://docs.microsoft.com/en-us/dax/search-function-dax

 

This formul  SEARCH("SP*",[fieldname],1,0) > 0 equals SEARCH("SP",[fieldname],1,0) > 0

It returns that if there is "SP" in the field, it will return ture.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tex628
Community Champion
Community Champion

Appear to be correct yes, I can't actually tell if theres any difference between SEARCH("SP" .... ) and SEARCH("SP*" .... ).
But i does work indeed!


Connect on LinkedIn

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.