How to Concatenate with Space in Power BI

    In this Power Bi tutorial, we will learn how to concatenate with space in Power BI with examples. In addition, we will also cover the below topics: 

    • How to concatenate two columns with space in Power BI
    • Concatenate two columns with space using Power query

    Power BI Concatenate with Space

    Let us see how we can concatenate two values with space using concatenate function in Power Bi,

    In this example, we will use the below-mentioned Products Table data to concatenate two values with space in Power Bi. Where the Product Name column is of text data type and the Sales column is of Number data type.

    Power BI Concatenate with Space
    Power BI Concatenate with Space

    Open the Power Bi desktop and load the data into the it using get data option, click on the new column, and use the below formula to concatenate two values with space.

     Concatenate with Space = CONCATENATE('Product Set A'[Product Name], CONCATENATE("  ", 'Product Set A'[Sales]))

    Where,

    1. Concatenate with Space = New Column Name
    2. Product Set A= Table Name
    3. Product Name, Sales = Existing Column Names

    In the below screenshot, the newly created column has displayed the concatenated values with space based on the applied condition:

    Power BI Concatenate with Space example
    Power BI Concatenate with Space example

    This is how to concatenate two values with space using concatenate function in Power Bi.

    Concatenate two columns with space in Power BI

    Here we will see how to concatenate two columns with space using the query editor in Power BI.

    Log in to the Power Bi desktop and load the data into it using the get data option Under the Home tab select the transform data option as highlighted below, it will automatically redirect to the Power Query editor.

    power bi concatenate with space
    power bi concatenate with space

    In the Power query editor, select the columns that you want to concatenate with space, and then Righ clicks on the selected and chooses the merge option as below:

    Power bi-concatenate two columns with space
    Power bi-concatenate two columns with space

    In the Merge column pop-up window, choose the separator as Space and enter the column name and click on the ok button to save your changes.

    Power bi-concatenate two columns with space example
    Power bi-concatenate two columns with a space example

    The Screenshot below displays the concatenated value with space in the newly added column. Click on the Home -> Close and Apply option so that the changes will be reflected in Power BI.

    = Table.AddColumn(#"Changed Type", "Merged", each Text.Combine({[Product Name], Text.From([Sales], "en-US")}, " "), type text)
    Example of Power bi-concatenate two columns with space
    Example of Power bi-concatenate two columns with space

    This is how to concatenate two columns with space using the query editor in Power BI.

    Also Read: How to Concatenate Text and Number in Power BI

    Power Query concatenate two columns with space

    Let us see how to concatenate two-column values with space using the power query editor in Power BI.

    In this example, we will concatenate two column values with space using the power query editor in Power Bi.

    • Open the Power Bi desktop and load the data into it using the get data option Under the Home tab select the transform data option. It automatically redirects to the Power Query editor.
    • In the Power query editor, select the Add Column-> Add a Custom column as shown below:
    • In the Custom column window, use the below formula to concatenate two values with space, and click on the OK button.
    Power Query concatenate two columns with space
    Power Query concatenate two columns with space
    • In the below screenshot, you can see that the new custom column has displayed the concatenated value with space.
    • Click on the Home -> Close and Apply option, so that the changes will be reflected on the Power Bi desktop.
    = Table.AddColumn(#"Changed Type1", "Custom", each [Product Name]&" "&[Sales])
    Power Query concatenate two columns with space example
    Power Query concatenate two columns with space example

    This is how to concatenate two-column values with space using the power query editor in Power BI.

    In this Power Bi tutorial, we have learned how to concatenate with space in Power BI with examples. In addition, we also covered the below topics: 

    • Power bi-concatenate two columns with space
    • Power Query concatenate two columns with space

    You may also like:

    >