Tag: add columns

The best way to choose (add and delete) columns from your dataset in Power BI Power Query

Often bringing data into Power Query, you may need to exclude (or later decide to include) some of the columns in the dataset from your Power BI model. Here we will go over the best way to do that – using the “Choose Columns” feature.

After bringing a file or table into Power BI, to manipulate it you can choose “Transform Data” in the Power Query Editor if you have not yet loaded it, or if you have already loaded it, then from the Table View select “Edit query” to open the table/query in the Power Query Editor.

In the Power Query Editor, from the Home ribbon, click the “Choose Columns” icon or click its drop down and select “Choose Columns”.

By default, all the columns are selected.  Then, from the Select Columns dialog, you can select (to keep) and unselect (to remove) any columns you chose to.

This is most useful when you have a query (table) with a lot of columns, and you need to remove several of them, and especially if they are not all right beside each other (not contiguous). This option is more convenient than scrolling through a wide table and using “Ctrl + Select” to select all the columns you want to keep or remove.

In addition, if you later realize you need to select or deselect another column, you can just go to the corresponding step in the “APPLIED STEPS” pane, select the step’s gear icon to reopen the Choose Columns dialog, and then select or deselect column(s) as necessary. This is much better than adding another step for performing additional column deletions or removing a previous step to undo previous column deletions.

Thanks for reading!