To concatenate columns in Power Query, you combine the text from two or more columns into a single column using either the Merge Columns command on the Transform tab or a custom column with the & operator. The merge approach is fastest for simple cases; the custom column gives you control over separators, formatting, and null handling. Both work in Excel and Power BI, and neither requires any add-in.

What You'll Need

  • Excel (2016 or later, or Microsoft 365) or Power BI Desktop with Power Query available.
  • Data loaded into Power Query: select your table and use Data > From Table/Range (Excel) or Home > Transform data (Power BI).
  • Columns you want to combine should be text, or convertible to text. Numbers and dates can be concatenated but will be converted to text automatically.

Step-by-Step

  1. Open Power Query Editor. In Excel, select your data and go to Data > From Table/Range. In Power BI, go to Home > Transform data. The Power Query Editor opens.
  2. Select the columns to concatenate. Click the first column header, then hold Ctrl (Windows) or Cmd (Mac) and click additional headers. The order you select determines the order of the merged text. To select adjacent columns, click the first, hold Shift, and click the last.
  3. Use Merge Columns (simple method). On the Transform tab (or Add Column tab if you want to keep the originals), click Merge Columns. In the dialog, choose a separator from the dropdown (e.g., Space, Comma, Semicolon, or Custom). Enter a name for the new column and click OK. The selected columns are replaced by one merged column (or added as a new column if you used Add Column).
  4. Alternatively, create a custom column for more control. Go to Add Column > Custom Column. In the formula box, type a formula like [FirstName] & " " & [LastName] to join with a space. Use & to concatenate text. For non-text columns, wrap them with Text.From(), e.g., [FirstName] & " " & Text.From([Age]). Click OK.
  5. Handle nulls and blanks. If a column contains null, the entire concatenation may become null. Use Text.Combine with a list and a separator to skip nulls: Text.Combine({[FirstName], [LastName]}, " "). This returns only the non-null values joined by the separator.
  6. Check the result. Scroll through the new column to verify the output. If you see errors, use the error dropdown to inspect the message. Common errors include type mismatches or null values.
  7. Adjust data types if needed. If the new column is not recognized as text, click the data type icon in the column header and select Text.
  8. Close and load. In Excel, go to Home > Close & Load to load the result to a worksheet or data model. In Power BI, go to Home > Close & Apply.

Common Mistakes

  • Forgetting to convert numbers to text. Concatenating a number directly with text may cause an error or unexpected formatting. Always use Text.From() for non-text columns.
  • Using the wrong separator. A missing space or comma can make the result unreadable. Double-check the separator in the Merge Columns dialog or your custom formula.
  • Merging columns that contain nulls. As noted, nulls can propagate. Use Text.Combine or replace nulls with empty strings before merging.
  • Selecting columns in the wrong order. The merge order follows your selection order. If the result is reversed, undo and reselect in the correct order.
  • Overwriting original columns unintentionally. Using Merge Columns on the Transform tab replaces the selected columns. If you need to keep them, use Add Column > Merge Columns instead.

Tips

  • Use Add Column > Merge Columns to keep the original columns for reference or further transformations.
  • For complex concatenations, consider using Text.Combine with a list of columns and a separator; it handles nulls gracefully.
  • If you need to concatenate many columns, you can use List.Transform and Text.Combine to build the list dynamically.
  • Remember that Power Query is case-sensitive in some functions; check the exact function names.
  • You can rename the new column immediately after creation by double-clicking the header.

Troubleshooting

If the merge does not work as expected, check these common issues:

  • Error: "We cannot convert the value null to type Text." This occurs when a column contains null and you use & without handling nulls. Replace nulls with empty text using Replace Values (right-click column > Replace Values, enter null as value to find and leave replace blank) or use Text.Combine.
  • Error: "We cannot apply operator & to types Text and Number." Convert the number column to text first: select the column, go to Transform > Data Type > Text, or use Text.From() in a custom column.
  • Merged column shows unexpected characters. Check the separator; if you used a custom separator, ensure it is exactly what you want (e.g., a comma followed by a space).
  • Columns not available in the Merge Columns dialog. Ensure you have selected at least two columns. The dialog only appears when multiple columns are selected.
  • Result is truncated or missing data. Verify that no filters are applied that hide rows, and that the columns are of compatible types.

Frequently Asked Questions

Can I concatenate more than two columns at once?

Yes. Select all the columns you want to merge (hold Ctrl or Shift) and use Merge Columns, or list them in a custom formula with & or Text.Combine.

How do I concatenate columns with a line break?

Use a custom separator in the Merge Columns dialog: choose Custom and type #(lf) for a line feed, or #(cr)#(lf) for a carriage return and line feed. In a custom column, use "#(lf)" as the separator string.

Will concatenation work if one column is empty?

If the column contains null, the result may be null unless you handle it. Use Text.Combine or replace nulls with empty text before merging.

Can I undo a merge?

Yes. Use the Undo button (Ctrl+Z) or delete the step in the Applied Steps pane. If you used Add Column, simply delete the new column.

Does concatenation work in Power BI Desktop?

Yes, the steps are nearly identical. In Power BI, open Power Query Editor via Home > Transform data, and use the same Merge Columns or Custom Column features.

What if I need to concatenate with a delimiter that is not in the list?

Choose Custom in the separator dropdown and type your delimiter, such as a pipe (|) or a hyphen.