Press "Enter" to skip to content

Full-Text Search with DAX

Marco Russo and Alberto Ferrari dig into a recent feature addition:

Searching text in a Power BI report usually means looking for a string inside the values of a column. For example, the filter pane translates a “contains” condition into a DAX expression based on CONTAINSSTRING or SEARCH, which look for a sequence of characters anywhere in the text; for example, a search for “phone” also returns “headphones” and “microphone”.

With a full-text index, search functions operate on words rather than characters. The text data is divided into words, also called tokens, and a following text-normalization technique called stemming reduces words to their root form. For example, “running” and “runs” both stem to “run”, whereas “runner” remains a different word. This way, a search for “phone” can return “phones”, but not “headphones”, because it has a different meaning. Also, full-text search can tolerate typos and rank results by relevance, which CONTAINSSTRING cannot do.

Click through to see how it works and what the current limitations are.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.