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.
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,
- Concatenate with Space = New Column Name
- Product Set A= Table Name
- 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:
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.
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:
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.
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)
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.
- 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])
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:
- Power BI Conditional Formatting Based on Measure
- Power BI Slicer Multiple Selection
- Power Query Check If Text is Date
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com