Do you want to duplicate multiple columns using the Power Query editor?, then this tutorial will help you to duplicate multiple columns at once in Power BI. And also it explains how to remove duplicates using the Power Query editor.
Duplicate multiple columns at once using Power Query
Let us see how to duplicate multiple columns at once using the Power Query editor in Power BI,
- In this example, I will use the Products Table data mentioned below. You can download the sample data from here, where we will make the multiple duplicate columns (two or more columns)
- Open the Power BI desktop, and load the table data into it, In the ribbon, under the Home option click on the Transform data option as shown below:
- So that it will redirect to the power query editor, where we can add duplicate multiple columns to the table.
- Select the column that you want to duplicate, right-click on it, and click on the Duplicate column as below: In this example, I have selected the index column and duplicated it once.
- Now to duplicate multiple columns at once, enter the below-mentioned formula in the formula box and select the check icon.
= Table.DuplicateColumn(#"Duplicated Column", "Index - Copy", "Index - Copy - Copy - Copy ")
- In the below screenshot, you can see that the index column has been duplicated. In the same way, follow the Select the column that you want to duplicate, right-click on it, and click on the Duplicate column. So that it will duplicate multiple columns at once.
- The Screenshot below represents the index column that has been duplicated two times.
- Click on the close and apply the option to reflect the changes on the Power BI desktop.
This is how to duplicate multiple columns at once using the Power Query editor in Power BI.
Read How to add an empty column in Power BI
Remove duplicates using Power Query
Let us see how to remove the duplicate values using the Power Query editor in Power BI,
- Open the Power BI desktop, and load the table data into it, In the ribbon, under the Home option click on the Transform data option as shown below:
- So that it will redirect to the power query editor, where we can remove duplicate values from the table.
- Select the column from which you want to remove duplicate values, right-click on it, and click on Remove Duplicates as below:
- To remove duplicate values, enter the formula below in the formula box and select the check icon.
= Table.Distinct(#"Removed Duplicates", {"Count of Custom.Country"})
- In the below screenshot, you can see that it removes duplicate values from the custom country column.
- Click on the close and apply the option to reflect the changes on the Power BI desktop.
This is how to remove the duplicate values using the Power Query editor in Power BI.
This tutorial demonstrated to you how to duplicate multiple columns at once and remove the duplicate values using the Power Query editor in Power BI.
You may like the following Power BI tutorials:
- How to Filter Blank Value in Power BI
- Power Query Add Column If Statement
- Power BI Dax Filter [With 15+ Examples]
- Power BI DAX Filter If [With Real Examples]
- How to add a column with a dropdown list in Power Query
- How to add a column with the same value in Power BI
- add column with a fixed value in Power BI
- How to add column from another table in Power BI
- How to Append Columns in Power Query
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