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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
DrBiDuro
Frequent Visitor

Remove columns in advanced wuery editor

Hi all, i am pretty new to power BI and I am encontering a lot of little questions all the time.

 

For example, I have 2 data providers that come from URL (Web) to extract sales. The incomvenient is that the column structure of both tables will differ every time i refresh as it is possible that one of both has no sales data, causing different header names.

 

Long story short, I need to remove and / or select the columns regardless of their name with the same instruction for both queries. The advanced editor shows this command:

 

#"Removed Columns" = Table.RemoveColumns(Data0,"Column1"}). Here Column1 is removed.

 

Is it possible to index the columns and make it look sth like this?:

 

#"Removed Columns" = Table.RemoveColumns(Data0,1}),

 

Thanks a lot and best regards!!!

1 ACCEPTED SOLUTION
v-haibl-msft
Microsoft Employee
Microsoft Employee

@DrBiDuro

 

I don’t think there is such a command according to Table.RemoveColumns. You can try with another alternative, first transposed table and then remove first row, transposed table at last.

 

#"Transposed Table" = Table.Transpose(Table2_Table),
#"Removed Top Rows" = Table.Skip(#"Transposed Table",1),
#"Transposed Table1" = Table.Transpose(#"Removed Top Rows")

 

Best Regards,
Herbert

View solution in original post

4 REPLIES 4
v-haibl-msft
Microsoft Employee
Microsoft Employee

@DrBiDuro

 

I don’t think there is such a command according to Table.RemoveColumns. You can try with another alternative, first transposed table and then remove first row, transposed table at last.

 

#"Transposed Table" = Table.Transpose(Table2_Table),
#"Removed Top Rows" = Table.Skip(#"Transposed Table",1),
#"Transposed Table1" = Table.Transpose(#"Removed Top Rows")

 

Best Regards,
Herbert

Herbert, thanks a lot, your solution fits perfectly!!!!

 

SOLVED!!!

arify
Microsoft Employee
Microsoft Employee

Hi, you can do something like this:

= Table.RemoveColumns(Data0, Table.ColumnNames(Data0, 0)})

ThomasTurbado
Frequent Visitor

I have the same problem too whit wuery Smiley LOL

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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