DAX CONCATENATE in Power Pivot: How to Combine Columns
In this article
To concatenate text in Power Pivot, use the DAX function CONCATENATE or the & operator inside a calculated column. For example, = [FirstName] & " " & [LastName] joins two columns with a space. CONCATENATE only accepts two arguments, so for three or more columns use the & operator or the newer CONCATENATEX function. The result is a new column you can use in PivotTables, slicers, or further calculations.
What You'll Need
- Excel with Power Pivot enabled (Excel 2013 or later; the Data Analysis Expressions engine is built in).
- A data model containing at least two text columns you want to combine.
- Basic familiarity with the Power Pivot window and calculated columns.
Step-by-Step
- Open the Power Pivot window. In Excel, go to the Power Pivot tab on the ribbon and click Manage. (If you don't see the Power Pivot tab, enable the add-in via File > Options > Add-ins > COM Add-ins > Go, then check Microsoft Power Pivot for Excel.)
- Select the table. In the Power Pivot window, click the tab for the table that contains the columns you want to concatenate.
- Add a calculated column. Scroll to the rightmost column, click the header cell that says Add Column, and type a name for your new column (e.g., FullName). Press Enter.
- Enter the DAX formula. In the formula bar, type one of the following (replace column names with your own):
- Two columns:
=CONCATENATE([FirstName], [LastName])or=[FirstName] & [LastName] - With a separator:
=[FirstName] & " " & [LastName] - Three or more columns:
- Two columns:
- Press Enter to create the column. Power Pivot calculates the values for every row. If you see an error, check that column names are spelled exactly and enclosed in square brackets.
- Format if needed. The new column inherits a text data type. You can change its format in the Home tab if necessary.
- Use the column in a PivotTable. Close the Power Pivot window and insert a PivotTable from the Data Model. The new calculated column appears in the field list and can be dragged into Rows, Columns, or Filters.
Common Mistakes
- Using CONCATENATE with more than two arguments. CONCATENATE accepts exactly two arguments. For three or more, use the & operator or CONCATENATEX.
- Forgetting quotes around literal text. Text strings must be in double quotes, e.g.,
" "for a space. Without quotes, DAX treats it as a column name. - Missing square brackets around column names. Column references must be enclosed in [ ], e.g., [FirstName], not FirstName.
- Assuming & works the same in all contexts. The & operator works in calculated columns and measures, but CONCATENATE is a function that also works. Both produce text.
- Ignoring blanks. If a column contains blanks, concatenation may produce unexpected results (e.g., a leading space). Use IF or COALESCE to handle blanks if needed.
Tips
- Use the & operator for readability when combining multiple columns; it's often easier than nesting CONCATENATE.
- To concatenate a range of values from related rows, use CONCATENATEX with an iterator. Example:
=CONCATENATEX(RelatedTable, [Value], ", "). - If you need to concatenate with line breaks, use UNICHAR(10) for a line feed (may require wrap text in Excel).
- Calculated columns are computed at refresh time, so they increase model size. For large models, consider creating the concatenation in Power Query instead.
- Test your formula on a few rows before applying to the whole table; you can always undo with Ctrl+Z.
Troubleshooting
- Error: "The name 'CONCATENATE' is not recognized." Ensure you are in a calculated column or measure context, not a Power Query formula. Power Pivot uses DAX, not M.
- Error: "Column 'X' cannot be found." Check the column name spelling and that the column exists in the same table. Use the formula autocomplete to insert correct references.
- Result shows unexpected spaces or missing separators. Verify your literal strings are in double quotes and that you've included spaces where needed.
- Column appears blank. If any input column is blank, the result may be blank. Wrap with IF(ISBLANK([Col]), "", ...) to handle.
- Performance slow. Concatenation in calculated columns can be heavy on large tables. Consider moving the logic upstream to Power Query or the source system.
Frequently Asked Questions
Can I concatenate more than two columns with CONCATENATE?
No, CONCATENATE only takes two arguments. Use the & operator to join three or more columns, or nest CONCATENATE calls (e.g., CONCATENATE(CONCATENATE([A],[B]),[C])).
What is the difference between CONCATENATE and & in DAX?
Both join text values. CONCATENATE is a function that accepts exactly two arguments; & is an operator that can chain multiple values. They produce the same result for two arguments.
How do I add a space between concatenated values?
Include a space in double quotes as a separate argument: =[FirstName] & " " & [LastName] or =CONCATENATE([FirstName], " " & [LastName]).
Can I use CONCATENATE in a measure?
Yes, but measures typically aggregate. CONCATENATE works in measures if you reference columns with an aggregator or use it with VALUES. For row-level concatenation, use a calculated column.
Why does my concatenated column show numbers as text?
Concatenation converts all values to text. If you need numeric formatting, use FORMAT function: .
Does CONCATENATE work with related tables?
You can use RELATED to pull a value from a related table: . Ensure a relationship exists.