Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Ehab
Regular Visitor

how do you remove columns in query editor

I imported an excel sheet with many columns

 

it's easy to select the columns i want in Report view, but in Query Editor  it shows all of them. how can they be in sync so whatever columns i see in Report view is also in Query Editor?

 

Thanks in advance

1 ACCEPTED SOLUTION

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. how do you remove columns in query editor.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
Ehab
Regular Visitor

Thanks guys. i was hoping for a bird's eye view like in the report view with checkboxes of all the columns - as i said, if it's 30+ columns, the scrolling and deleting one-by-one (even with SHIFT & CTRL shortcuts to delete in groups) is cumbersome ...  but sounds like it doesn't exist. 

 

Appreciate the prompt responses.

 

 

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. how do you remove columns in query editor.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for this!

 

and thank you everybody

Anonymous
Not applicable

Hi @Ehab,

 

1. When you enter the query editor just select the column you want to delete (like in my picture below)

2. You can also select all columns you want to keep and press remove other columns (you can select multiple by holding CTRL)

Capture.PNG

 

 

When you delete it in query editor it will also be deleted from the report view.

 

Regards,

 

L.Meijdam

 

thanks, 

 

i was just wondering if there was an easy view as in the report menu  shown below ... when you have 30+ columns and you only want a handful, the approach you mention is very time consuming (apologies on the screen shot ... blocked out much of it below for confidentiality reasons ... there are 30+ fields ... being able to scroll quickly and check the ones i want is very convenient

 

 screen shot.png

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)

I don't know if you still need to know a way to easily select the columns you want but next to <Remove Columns> there is <Choose Columns> which allows you to selct the columns you would like to keep shown in a list format

You can also hold down Shift or maybe Ctrl key to select the columns you want and then right click and remove other columns.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Ehab,

 

On  the query editor if you do CTRL + click on the columns you want and the DELETE on the keyboard it will do all columns at once.

 

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Greg_Deckler
Super User
Super User

In Query Editor, right-click the columns that you do not want and remove them.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.