Forum Discussion

Rak14's avatar
Rak14
Frequent Visitor
3 years ago
Solved

Consolidating Text Cells in Power Query in Power BI

In Power Query within Power BI, I encounter a situation where certain text cells in columns 2, 3, and 5 start with "Visits for ...". My objective is to extract this text and consolidate it into a new, single column. Subsequently, I intend to use the "Fill Down" operation to propagate the extracted values consistently throughout the column.

 

However, when attempting to achieve this using a conditional column with "else if" options, I face a challenge. The conditional column setup only considers values from column 2 and disregards columns 3 and 5, resulting in a failed outcome.

 

I am seeking your assistance in providing an alternative approach to accomplish this task successfully. Could you please suggest the steps I should follow to address this issue? 

 

below sample columns and expected output as new column.

 

 

 

  • In Power Query, you can create a new column that is a merge of three other columns using the "Add Column" feature.

     

    Here's how:

    Suppose you have three columns named Column1, Column2, and Column3, and you want to merge them into a new column called "MergedColumn."

     

    1. Select the table that contains the three columns in the Power Query Editor.
    2. Go to the "Add Column" tab in the Power Query Editor.
    3. Click on "Custom Column."

    In the "Custom Column" dialog, enter the formula for merging the three columns using the "&" operator:

     

     

2 Replies

  • foodd's avatar
    foodd
    Community Champion

    In Power Query, you can create a new column that is a merge of three other columns using the "Add Column" feature.

     

    Here's how:

    Suppose you have three columns named Column1, Column2, and Column3, and you want to merge them into a new column called "MergedColumn."

     

    1. Select the table that contains the three columns in the Power Query Editor.
    2. Go to the "Add Column" tab in the Power Query Editor.
    3. Click on "Custom Column."

    In the "Custom Column" dialog, enter the formula for merging the three columns using the "&" operator:

     

     

  • foodd's avatar
    foodd
    Community Champion

    Please mark it as a Solution if it has met your request so that others are able to find it easier.