From the course: Excel: Power Query (Get & Transform)

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Merge columns

Merge columns

Merging columns is a common need. And when we do that in Power Query, there are some things to watch out for. Let's get into it. Cursor in the dataset, right-click, from Table/Range. Let's slide over, and let's say that we want to create a full ID that has the department, a hyphen and then the ID. Now, I have to select these in order; department, and then hold on to control key, ID. Now, I'm going to go to Transform and then merge columns. What do I want as a separator? I want a hyphen. I'm going to go down to Custom, type in a hyphen. Great. Okay. The columns are now merged. But also, notice our source columns are gone. Slide over a bit to verify that. Yep. There's just the first name over there. Our original columns are gone. I'm going to get rid of this step. And sometimes, you do want those source columns to go away. Other times you want to keep them. Let's try this. I'm going to slide over, department, hold on to control key, ID. Now, I'm going to go to Add Column, merge columns,…

Contents