You are currently viewing Power BI concatenate two columns with space
Power BI concatenate two columns with space using DAX and Power Query

Power BI concatenate two columns with space

In this post, we will learn how to perform Power BI concatenate two columns with space using DAX and M Query to combine multiple values in one column in Power BI.

Power BI concatenate two columns with space
Power BI concatenate two columns with space

Power BI concatenate two columns

In some cases, you may need to concatenate two columns and combine the result in one column. so, you can easily use DAX CONCATENATE to join two text strings into one text string.

Full Name = CONCATENATE(Text1,Text2)

Unfortunately, the CONCATENATE DAX function doesn’t allow me to concatenate two columns with space!

Concatenate DAX function

In this case, you can use ampersand & in a calculated column or a custom column to combine two or more columns with space in Power BI and get the desired value as below.

Power BI concatenate two columns with space
Power BI concatenate two columns with space

In this post, we will provide two methods to perform Power BI concatenate columns using DAX and M.

You might also need to read Power BI: DAX Vs M Language

Power BI concatenate two columns using DAX

To concatenate two columns using DAX in Power BI, you have to do the following:

Steps

  1. From the left side, Click on Data View icon.
Data view in Power BI
Data view in Power BI
  1. In the Data view, Make sure the current table is the table that you need to combine multiple columns.
  2. At Table Tools tab, click on “New Columns” to create a new caclulated column in your table.
create a calculated column in Power BI using DAX
create a calculated column in Power BI using DAX
  1. Write the below DAX formula to concatenate two columns with space in Power BI
Full Name = Employee[First Name] & " " & Employee[Last Name]
  1. Great, the new calculated column is now created and show the combined value in a new column as shown below.
Power BI concatenate two columns with space
Power BI concatenate two columns with space

Power BI concatenate two columns using Power Query

To concatenate two columns using Power Query in Power BI, you have to usw M language as the following:

Steps

  1. In “Home” tab, click on “Transform Data” to open Power Query Editor.
transform data in Power BI
transform data in Power BI
  1. At the left side, and specifically at Queries section, make sure that you have select the required table.
transform data using Power Query in Power BI
transform data using Power Query in Power BI
  1. At the “Add column” tab, click on “Custom Column” to create a new column using M Language.
add custom column in Power BI
add a custom column in Power BI
  1. The custom column editor should be shown now to write your formula.
Power BI concatenate two columns using Power Query
Power BI concatenate two columns using Power Query
  1. At “New column name“, provide your column name.
  2. At “Custom column formula” textbox, write the below simple formula to combine two columns with space in Power BI.
[First Name] & " " & [Last Name]
  1. Great, the new custom column has been created with the desired result.
Power BI concatenate two columns 1 | Power Platform Geeks
Power BI concatenate two columns
  1. Close and apply your changes to can use the new column in your visuals and model.

Conclusion

In conclusion, we have learned how to perform Power BI concatenate two columns with space, and you can also use the same way to concatenate multiple columns and combine the value in one column.

See Also

Mohamed El-Qassas

I'm Microsoft MVP, SharePoint StackExchange Moderator, Microsoft QnA Moderator, C# Corner MVP, Microsoft TechNet Wiki Judge, and Senior Technical Consultant with +12 years of experience in SharePoint, Project Server and Power Platform.