SEARCH DAX Function (Text)

Returns the starting position of one text string within another text string. SEARCH is not case-sensitive.

Syntax

SEARCH ( <FindText>, <WithinText> [, <StartPosition>] [, <NotFoundValue>] )
Parameter Attributes Description
FindText

The text you want to find. You can use the ? and * wildcard characters; use ~? and ~* to find the ? and * characters.

WithinText

The text in which you want to search for FindText.

StartPosition Optional

The character position in WithinText at which you want to start searching. If omitted, the default value is 1.

NotFoundValue Optional

The numeric value to be returned if the text is not found; if omitted, an error is returned.

Return values

Scalar A single integer value.

The number of the starting position of the first text string from the first character of the second text string.

Remarks

SEARCH supports wildcards, whereas FIND does not.

Related functions

Other related functions are:

Last update: Dec 13, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/search-function-dax

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of SEARCH? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.