Reusing a Power Query script

If you are regularly using Power Query to create the same transformations on the same dataset, it may be preferable to create a template file so that you don’t have to always start from scratch.

  1. In the Power Query window, go to Advanced Editor from the Home tab.
  2. Copy the full code from the ‘let’ statement to the clipboard.
  3. In the new Excel file, go to Power Query – From Other Sources – Blank Query and again go into Advanced Editor.
  4. Now you can paste the query steps from the template file.

Note that if you created any cross-query references (such as a Merge/Append operation), you may also need to copy over all the other related queries.

Leave a Reply

Your email address will not be published. Required fields are marked *