TEXTSIMILARITY DAX Function (Information)

Returns a relevance score (BM25) indicating how well the text in the column matches the search text. Higher scores mean greater relevance.

Syntax

TEXTSIMILARITY ( <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 decimal value.

A floating-point lexical relevance score. Within one evaluation, a higher score indicates a stronger match, and 0 indicates no match.

The score is an opaque ranking value, not a percentage, probability, or normalized similarity measure. Compare scores only within the same search context.

Scores aren’t guaranteed to be comparable or stable across separate query executions, search strings, columns, filter contexts, data sources or storage modes, index contents or generations, or execution plans. These factors can change the scoring corpus or scoring implementation even when visible text values are unchanged.

Remarks

MatchMode:

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

TEXTSIMILARITY 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 0, 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 the function scores them.

Because stop words and stemming change the tokens that the index stores, the same column can get a different score in a different model language. The description of the return value already explains that the score is an opaque BM25 ranking value, not a percentage, and that scores are not always comparable across queries.

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 TEXTSIMILARITY 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/textsimilarity-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 TEXTSIMILARITY? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.