DAX Function Guide
SEARCH
Sam McKay
CEO & Founder
How does the SEARCH work?
SEARCH Formula Syntax
SEARCH (
<find_text>, <within_text>, [<start_num>] [, <NotFoundValue> ]]
)
How do you use the SEARCH?
- The search function is case insensitive. Searching for “N” will find the first occurrence of ‘N’ or ‘n’.
- The search function is accent sensitive. Searching for “á” will find the first occurrence of ‘á’ but no occurrences of ‘a’, ‘à’, or the capitalized versions ‘A’, ‘Á’.
- By using this function, you can locate one text string within a second text string, and return the position where the first string starts.
- You can use the SEARCH function to determine the location of a character or text string within another text string, and then use the MID function to return the text, or use the REPLACE function to change the text.
Related Blog Posts
Loading
Considerations when using the SEARCH?
If the find_text cannot be found in within_text, the formula returns an error. This behavior is like Excel, which returns #VALUE if the substring is not found. Nulls in within_text will be interpreted as an empty string in this context.
Related Video Tutorials
Loading
Formula examples using the SEARCH
=SEARCH(“n”,”printer”)
=SEARCH(“-“,[PostalCode])
= IFERROR(SEARCH(“-“,[PostalCode]),-1)= IFERROR(SEARCH(“-“,[PostalCode]),-1)
Related Courses
Loading