CONCATENATEX

Updated on

CONCATENATEX is a DAX function that evaluates an expression for each row in a table and returns the concatenation of those values into a single string, separated by a specified delimiter.

Syntax

CONCATENATEX(
   Table,
   Expression,
   Delimiter,
   [ OrderBy_Expression, ... ],
   [ Order, ... ]
)
Argument Properties Description
Table The table containing the rows for which the expression will be evaluated.
Expression The expression to be evaluated for each row of the table.
Delimiter Optional The delimiter to be concatenated with expression.
OrderBy_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

A concatenated string.

Remarks

  • This function takes as its first argument a table or an expression that returns a table. The second argument is a column that contains the values you want to concatenate, or an expression that returns a value.

  • Concatenated values are not necessarily sorted in any particular order, unless orderBy_expression is specified.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

Employees table

FirstName LastName
Alan Brewer
Michael Blythe

The following formula:

= CONCATENATEX(Employees, [FirstName] & " " & [LastName], ",")

Returns: “Alan Brewer, Michael Blythe”

Other functions related to CONCATENATEX are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/concatenatex-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy