You are learning Power Query in MS Excel
How to combine multiple columns into a single column in Power Query?
There are two main ways to combine multiple columns into a single column in Power Query:
1. Merge Columns:
This method is suitable when you want to concatenate the values from multiple columns with a specific separator between them. Here's how:
* Select the columns you want to combine (hold Ctrl and click on each column header).
* Go to the "Transform" tab.
* Click on "Merge Columns."
* In the "Merge Columns" dialog box, choose the separator you want to insert between the values from each column (e.g., comma, space, hyphen).
* Click "OK".
2. Custom Column Formula:
This method offers more flexibility, allowing you to combine column values and potentially perform other transformations within the formula. Here's how:
* Go to the "Add Column" tab.
* Click on "Custom Column."
* In the formula bar, enter a formula that combines the values from your chosen columns. You can use the & symbol to concatenate text and reference columns using their names within square brackets (e.g., = [Column1] & " - " & [Column2]).
* You can also use conditional logic within the formula to manipulate the output based on specific criteria.
* Name your new column and click "OK."
Here are some additional points to consider:
* Both methods will create a new column with the combined values.
* You can choose to hide or delete the original columns if you no longer need them.
* The order in which you select the columns for merging will determine the order of appearance in the final combined column.
* With the custom column formula, you have more control over formatting and data manipulation within the combined column.
Choose the method that best suits your specific needs based on the desired outcome and any additional transformations required.