Forum Discussion

julioninjatron2's avatar
julioninjatron2
Frequent Visitor
3 years ago

How do I stop PowerQuery from adding new columns that are added at the source?

In my scenario, I have an excel file that uses PowerQuery to connect to a SharePoint List. I've removed all unwanted columns and won't need any new columns that are added to the List. 

 

On refresh, it automatically adds any new columns that are created on the list. Is there a way to stop this from happening?

3 Replies

    • Have a list of the columns to be retained someplace
      • maybe in your Excel Workbook, as a named Range or Table.
      • Or just refer to the column headers of the existing Table
    • In your PQ code, refer to that list to decide which columns to be Selected
  • ppm1's avatar
    ppm1
    Solution Sage

    You can click on the Choose Column button in the toolbar, or ctrl-click each of the desired columns, right click and choose Remove other columns. This will create a step to keep just the desired columns and any new columns will be automatically removed too.

     

    Pat