TEXTCONTAINS DAX Function (Information)

Returns TRUE if the text in the column matches the search text using full-text query semantics.

Syntax

TEXTCONTAINS ( <WithinTextColumn>, <SearchText> [, <MatchMode>] )
Parameter Attributes Description
WithinTextColumn

A column that contains text values to be searched.

SearchText

A text string that defines the search condition.

MatchMode Optional

An optional enumeration that defines the match mode: TEXTMATCHING (default), FUZZYMATCHING, or PHRASEMATCHING.

Return values

Scalar A single boolean value.

TRUE if the text in within_text_column matches search_text according to match_mode; otherwise, FALSE.

Remarks

Use of MatchMode:

Mode Behavior
TEXTMATCHING Tokenizes search_text and matches text that contains any of the search terms.
FUZZYMATCHING Matches tokens that are similar to search tokens within a small edit distance, which supports typo-tolerant matching.
PHRASEMATCHING Matches analyzed tokens that appear next to each other and in the specified order. Punctuation doesn’t affect the token sequence.

TEXTCONTAINS requires a persisted full-text index on WithinTextColumn. The index is available for Import, Dual, and Direct Lake storage modes. Other storage modes return an error.

The search is not case-sensitive. The search is accent-sensitive. For example, cafe does not match café.

The model language controls stemming and the removal of stop words. The collation of a column does not control this behavior. The supported languages are English, French, German, Spanish, Portuguese, Russian, Arabic, Turkish, Danish, Dutch, Finnish, Greek, Hungarian, Italian, Norwegian, Romanian, Swedish, and Tamil. For a language that is not in this list, the function uses a generic lowercase tokenizer, with no stemming and no removal of stop words.

The function does not use synonyms. For example, a search for fridge does not find refrigerator.

The tokenizer splits text at whitespace, including the ideographic space, and at punctuation or symbols. In our tests, the Japanese period, the Japanese comma, a hyphen, an underscore, and a slash were token boundaries. A change of script, for example from Latin letters to another writing system, is not a token boundary. In languages that do not put spaces between words, such as Japanese, Chinese, and Thai, a word that sits inside a longer string of characters does not match. The function returns FALSE, and it does not return an error. The result can look as if the data is not there, when the word is in the column. This tokenization is the same in a supported language, such as English, and in an unsupported language, such as Japanese.

The word matches when the column value is that word alone, or when the text is already split with spaces or with other separators. We tested this with Japanese in model languages ja-JP and en-US. We also ran a limited test with one Chinese sentence and one Thai sentence, and the exact search gave the same pattern.

The tokenizer does not normalize character width and it does not normalize Japanese kana forms. A full-width Latin letter does not match the ASCII letter. Different kana forms of the same word do not match each other.

In FUZZYMATCHING, our tests matched tokens at an edit distance of 2 and did not match tokens at an edit distance of 3, also for a search term of two characters. Short tokens can match words that are not related.

In a model that uses a supported language, Latin words that are separated by spaces get stemming and stop-word removal, also when the same text contains words from an unsupported language. A Latin word that is attached to a character of another script does not match.

In a supported language, a search that contains only stop words fails, with an error that no tokens remain after analysis. In an unsupported language, those words are kept, and TEXTSIMILARITY scores them.

SearchText must be a constant for the whole query. A search text that depends on the current row returns an error.

This function is not supported in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Related articles

Learn more about TEXTCONTAINS in the following articles:

Related functions

Other related functions are:

Last update: Nov 18, 2026   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Takeshi Kagata

Microsoft documentation: https://learn.microsoft.com/en-us/dax/textcontains-function-dax

2018-2026 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

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.

Passed by Expression

This parameter is passed by expression and can be evaluated multiple times in different evaluation contexts.

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.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

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