Merging columns
A typical transformation under the Add Column category is Merge Columns. There are many use cases where we need to merge the data that's been spread across different columns, such as merging First Name
, Middle Name
, and Last Name
to create a Full Name
column, or merging a multipart address that's being held in separate columns (AddressLine1
, AddressLine2
) to get an Address
column containing the full address. Another common use case is to merge multiple columns to create a unique ID column. Let's continue with an example from the Chapter 5, Common Data Preparation Steps.pbix
sample file:
- Select the
Customer
table from the Queries pane of Power Query Editor. - Select the
First Name
,Middle Name
, andLast Name
columns. - Right-click one of the selected columns and click Merge Columns. Alternatively, we can click the Merge Column button from the Transform tab (shown in yellow in the following image).
- Select Space from the Separator dropdown...