RedditPP Mascot

RedditPP

r/excel • … • u/ShinDragon

A way to dynamically choose which column to remove from Power Query ?

I have a data set that is a report appended from 4 other department, basically my company's sale data. The problem is that each department sometimes report the wrong historical data (Like I would just want them to update July data and then somehow the data they send me have some changes since January), and each month there's a potential new goods being sold.

My approach is to make 5 different data set, one is the historical data, and 4 from the departments, then I would create query connection from those data sources, remove the current month from the historical data, remove historical columns from the 4 other sources, then append them.

My question is that is there a way for me to quickly and dynamically choose the columns I want to remove, or do I have to edit those steps each time ? It doesn't take much time to edit each time TBH, but if there's a way to automate it I would want to make use of it. VBA is fine in my case.

My company uses Excel 2016 if that is relevant.

— 0