Forum Discussion
How to reuse PQ transformation steps or create a PQ template?
Hi,
Each day I download a excel-file with data to be analyzed. However, before I can analyze the data I need to make some transformation changes, e.g. delete some columns, divide some, sort by date and so on. I would like to only make these transformations once and save them as a "template" which later can be used in the next excel file. I don't want to combine the files, just reuse the transformation steps. I have tried using Power Query for this, but I am very new to using Power Query so I can't seem to get it to work properly.
How can I get this to work with Power Query or is there any other way to do this?
You can create a custom function. But if you are really new, start here: https://learn.microsoft.com/en-us/powerquery-m/understanding-power-query-m-functions
It is not really hard if you have some coding experience.
The UI also gives some support.
If you want a solution, you could post the query here for someone to convert to a function.
I don't have access to my laptop at the moment, so it will have to be someone else...
- Anonymous2 years ago
You could just open yesterday's workbook with the query that you used, and change the Source to the newest file. Then all of your steps will apply to the new file.
--Nate
2 Replies
- PwerQueryKees
Super User
You can create a custom function. But if you are really new, start here: https://learn.microsoft.com/en-us/powerquery-m/understanding-power-query-m-functions
It is not really hard if you have some coding experience.
The UI also gives some support.
If you want a solution, you could post the query here for someone to convert to a function.
I don't have access to my laptop at the moment, so it will have to be someone else...
- AnonymousNot applicable
You could just open yesterday's workbook with the query that you used, and change the Source to the newest file. Then all of your steps will apply to the new file.
--Nate