DAX CONCATENATEX function
Joins the results of an expression for each row into one text, with a separator.
CONCATENATEX turns a list into a sentence: the products sold, the countries selected. It is handy in tooltips and titles.
Syntax
CONCATENATEX(<table>, <expression>[, <delimiter>[, <orderBy_expression>[, <order>]]])| Argument | Required | Description |
|---|---|---|
| table | Required | The rows to go through, often VALUES(column). |
| expression | Required | The text for each row. |
| delimiter | Optional | The separator, like ", ". |
| orderBy_expression | Optional | What to sort the items by. |
| order | Optional | ASC or DESC. |
Returns: A text.
Examples
Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).
1. The products in view
Product List = CONCATENATEX(VALUES(financials[Product]), financials[Product], ", ", financials[Product], ASC)Result: Amarilla, Carretera, Montana, Paseo, Velo, VTT
All six products, sorted A to Z.
Good to know
- Long lists make unreadable visuals. Combine with TOPN to show the top few only.
Related functions
Official reference: CONCATENATEX function on Microsoft Learn