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.

Related functions

Other related functions are:

Last update: Oct 11, 2026   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

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.


This site is protected by reCAPTCHA.