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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.


@ 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!:
The Definitive Guide to Power Query (M)

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.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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