You may want this free add-in for functions
Video and discussion about using parameters from Excel in Power Query
Pass parameters from a name to a query
Pass parameters from a table to a query
Create dynamic tables with Power Query
Use when Excel's LARGE() function is needed in Power Query
Combine worksheets into one table