If(ProductName like '*bike*', 'Bikes')

The like operator and string comparisons in Power BI

Qlik's like matches against a pattern with * (any characters) and ? (one character). DAX's closest equivalents are CONTAINSSTRING, which is case-insensitive and supports * and ?, and SEARCH. Power Query has no wildcard operator. Use Text.Contains, Text.StartsWith and Text.EndsWith, with a comparer to ignore case.

Partial / different approach DAX Power Query

Short answer: Translate x like '*bike*' to CONTAINSSTRING(x, "bike") in DAX or Text.Contains([x], "bike", Comparer.OrdinalIgnoreCase) in M. For x like 'A*', use Text.StartsWith.

What it does in Qlik

string1 like string2 returns True (-1) if string1 matches the pattern, where * is any run of characters and ? is one character. For lists of patterns, use WildMatch.

Qlik example

Qlik script and chart
If(ProductName like '*bike*', 'Bikes', 'Other')
If(Code like 'A??-*', 'Type A')

Power BI equivalent

DAX

DAX
Group = IF ( CONTAINSSTRING ( T[ProductName], "bike" ), "Bikes", "Other" )
// like 'A??-*'  ->  anchor with LEFT / MID
Type A = IF ( LEFT ( T[Code], 1 ) = "A" && MID ( T[Code], 4, 1 ) = "-", "Type A" )

Power Query

Power Query M
= Table.AddColumn(Src, "Group", each
    if Text.Contains([ProductName], "bike", Comparer.OrdinalIgnoreCase)
    then "Bikes" else "Other", type text)
// like 'A??-*'; Text.Middle doesn't error on short codes, Text.At would
= Text.StartsWith([Code], "A", Comparer.OrdinalIgnoreCase) and Text.Middle([Code], 3, 1) = "-"

Gotchas and behaviour differences

  • CONTAINSSTRING and SEARCH look for the pattern anywhere in the text. Qlik's like is anchored, so 'A*' means "starts with A". Add a LEFT or RIGHT check, or use Text.StartsWith in M, to anchor.
  • Power Query string functions are case-sensitive by default. Pass Comparer.OrdinalIgnoreCase as the last argument.

Official documentation

Related pages

Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.