CONCATENATEX DAX Function in Power BI

The CONCATENATEX DAX function in Power BI is used to concatenate text values from a table or column, optionally using a delimiter and an order.

DAX Syntax CONCATENATEX(table, expression[, delimiter [, orderBy_expression [, order]]...])

The function has the following parameters:

Returns A single text string containing the concatenated values.

Example: Let’s have a table named StudentsTable in the Power BI.

CONCATENATEX DAX function in Power BI

Let’s concatenate the values from the Name column with comma delimiter (,) and sort the result using the [Name] column in ascending order.

DAX

CONCATENATEX Measure = 
CONCATENATEX (
    StudentsTable,
    StudentsTable[Name],
    ", ",
    StudentsTable[Name], ASC
)

The output of the above code is shown below:

CONCATENATEX DAX function in Power BI

The result is sorted alphabetically by [Name] column.

DAX

CONCATENATEX Measure 2 = 
CONCATENATEX (
    StudentsTable,
    StudentsTable[Name] & " : " & StudentsTable[State],
    UNICHAR(10),
    StudentsTable[Name], ASC
)

Here, the UNICHAR(10) inserts a newline.

CONCATENATEX DAX function in Power BI

Note: CONCATENATEX is context-aware: it respects filters and row contexts in visuals or measures.