I am not familiar with Power Query, but I do something similar with MS-Query. I use MS-Query to establish the connection to the database. MS-Query has a query editor similar to MS-Access but except for very simple queries, it is more of a hindrance than a help. In my case, I work with Oracle databases. I write and debug the code there and then copy it into the SQL window for MS-Query.
If MS-Query can display it graphically, then I can pass parameters to it either at run-time though a dialog box or through cells on the spreadsheet. The cells could have dynamic formulas like TODAY()-1 and TODAY()-91 or whatever.
If MS-Query cannot display the SQL graphically, then I have a method using Excel Tables and a short piece of VB code to re-write the query prior to execution. This not only allows me to pass parameters, but I have done things like switch tables, rewrite where clauses and just about anything else as long as I stay in the same data connection (database).
If you are interested, I can walk you through the setup.
Bookmarks