Forum Discussion
how do you remove columns in query editor
- 8 years ago
Hi Ehab,
1. If you want to delete some columns, you can also do it in the Data or Report pane.
2. There is a view of all the columns in the Query Editor.
Best Regards!
Dale
I dont know if you know this already so I thought i would just put it out there but next to <Remove Columns> there is <Choose Columns> which provides an easy view for you to select which columns you would like to keep
Another way to remove multiple columns is to use the editor.
First delete a column. In the equation box find the name of previous step in the string. In the case below the previous step was #"Sorted Rows"
= Table.RemoveColumns(#"Sorted Rows",{"PF-3_MS-3_16"})
Now replace the entire string with the one below using the name of your previous step. Replace the leading characters of the row/s you want deleted with the "PC" below and/or replace "search" with your search string that you want to find. This will remove all columns containing your designated characters.
= let columnsToRemove = List.Select(Table.ColumnNames(#"Sorted Rows"),each Text.StartsWith(_,"PC")or Text.Contains(_, "search")) in Table.RemoveColumns(#"Sorted Rows", columnsToRemove)