CONCATENATEX DAX Function (Text)

Evaluates expression for each row on the table, then return the concatenation of those values in a single string result, seperated by the specified delimiter.

Syntax

CONCATENATEX ( <Table>, <Expression> [, <Delimiter>] [, <OrderBy_Expression> [, [<Order>] [, <OrderBy_Expression> [, [<Order>] [, … ] ] ] ] ] )
Parameter Attributes Description
Table
Iterator

The table containing the rows for which the expression will be evaluated.

Expression
Row Context
By Expression

The expression to be evaluated for each row of the table.

Delimiter Optional

The delimiter to be concatenated with expression.

OrderBy_Expression
Row Context
By Expression
Optional
Repeatable

Expression to be used for sorting the table.

Order Optional
Repeatable

The order to be applied. 0/FALSE/DESC – descending; 1/TRUE/ASC – ascending.

Return values

Scalar A single string value.

A text string with the concatenated values. The result is BLANK when Table has no rows.

Remarks

This function iterates the rows in the table provided by the first argument and for each row it executes the expression provided in the second argument. All the expressions are concatenated using the separator provided as third argument.

The default order is ASC (ascending) when OrderBy_Expression argument is present and the corresponding Order argument is not specified.

If the OrderBy_Expression argument is not specified, the items in Table can be evaluated in any order, returning a string that does not reflect any existing physical order in the source data.

Delimiter is optional. Without Delimiter, CONCATENATEX joins the values with no separator. Delimiter is not evaluated in the row context of Table, so it cannot use the columns of Table.

CONCATENATEX returns BLANK when Table is empty. A BLANK value of Expression becomes an empty string, but CONCATENATEX still adds the delimiter. For example, CONCATENATEX ( { 1, BLANK (), 3 }, [Value], “,” ) returns “1,,3”. To skip the BLANK values, remove them from Table, for example with FILTER.

You can use more than one OrderBy_Expression. CONCATENATEX sorts by the first OrderBy_Expression, then by the next one when the values are equal. Each Order argument applies to the OrderBy_Expression before it. Order accepts ASC, DESC, TRUE, FALSE, 1, and 0.

» 7 related articles
» 1 related function

Examples

--  CONCATENATEX is an iterator that produces the concatenation
--  of expressions evaluated during the iteration.
--  You provide the expression, a separator and optional
--  sorting expressions.
EVALUATE
ADDCOLUMNS (
    VALUES ( 'Product'[Category] ),
    "Category colors", 
        CONCATENATEX ( 
            CALCULATETABLE ( VALUES ( 'Product'[Color] ) ),
            Product[Color],
            ", ",             -- Separator (optional)
            Product[Color],   -- Sorting expression (optional)
            ASC               -- Sorting direction (optional)
        )
)
Category Category colors
Audio Black, Blue, Green, Orange, Pink, Purple, Red, Silver, White, Yellow
TV and Video Black, Brown, Silver, White
Computers Black, Blue, Brown, Gold, Green, Grey, Orange, Pink, Red, Silver, White, Yellow
Cameras and camcorders Azure, Black, Blue, Gold, Green, Grey, Orange, Pink, Purple, Red, Silver, Silver Grey, White, Yellow
Cell phones Black, Gold, Grey, Pink, Red, Silver, Transparent, White
Music, Movies and Audio Books Black, Blue, Gold, Grey, Red, Silver, White, Yellow
Games and Toys Black, Blue, Gold, Green, Grey, Pink, Purple, Red, Silver, White, Yellow
Home Appliances Black, Blue, Brown, Gold, Green, Grey, Orange, Pink, Purple, Red, Silver, White, Yellow

Related articles

Learn more about CONCATENATEX in the following articles:

Related functions

Other related functions are:

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

Contributors: Alberto Ferrari, Marco Russo, Francis Romio, Airat Gabdrakhmanov

Microsoft documentation: https://learn.microsoft.com/en-us/dax/concatenatex-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 CONCATENATEX? 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.