Concat(DISTINCT Product, ', ')

Concat (string aggregation) in Power BI

Concat() joins values into one string. DAX has CONCATENATEX and Power Query has Text.Combine. The sort order and the duplicate handling are different from Qlik's defaults.

Direct equivalent DAX Power Query

Short answer: Concat(DISTINCT Product, ', ') becomes CONCATENATEX(VALUES(Product[Name]), Product[Name], ", ", Product[Name], ASC). Always pass the order-by argument.

What it does in Qlik

Concat([DISTINCT] string [, delimiter [, sort_weight]]) concatenates values over the records in scope. Without DISTINCT, duplicates are kept. When sort_weight is omitted, Qlik sorts the values alphanumerically.

Qlik example

Qlik chart and script
// chart
Concat(DISTINCT Product, ', ')
Concat(DISTINCT Product, ', ', -Sales)   // ordered by sales, high to low (sort_weight)

// script
LOAD OrderID, Concat(DISTINCT Product, ', ') AS Products
RESIDENT OrderLines GROUP BY OrderID;

Power BI equivalent

DAX measure

DAX
Product list =
CONCATENATEX ( VALUES ( Product[Name] ), Product[Name], ", ", Product[Name], ASC )

Products by sales =
CONCATENATEX ( VALUES ( Product[Name] ), Product[Name], ", ", [Sales], DESC )

Power Query (script equivalent)

Power Query M
= Table.Group(
    OrderLines, {"OrderID"},
    {{"Products", each Text.Combine(List.Sort(List.Distinct([Product])), ", "), type text}}
  )

Gotchas and behaviour differences

  • CONCATENATEX without an order-by argument has no guaranteed order. Qlik sorts alphanumerically by default.
  • VALUES(...) already removes duplicates (the DISTINCT part). To keep duplicates as Qlik does without DISTINCT, iterate the fact table: CONCATENATEX(Sales, RELATED(Product[Name]), ", ").
  • Qlik's alphanumeric sort and DAX's text sort can order mixed numbers and text, or accented characters, differently.
  • Nulls: Qlik's Concat ignores null values. Text.Combine also skips nulls (Text.Combine({"Seattle", null, "WA"}, ", ") returns "Seattle, WA"), but an empty string "" is kept and gives a doubled separator. CONCATENATEX includes BLANK rows as empty text, so filter them out (FILTER(VALUES(...), NOT ISBLANK(...))) to match Qlik.

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.