Power Query Parameters

sricc

New Member
Joined
Nov 21, 2014
Messages
12
Hello! I am relatively new to Power Query. I have loaded a SQL Server query into Power Query so it can be used by others. The query will return payroll deduction data for union dues. In order to use it, I must go into the source code to edit the 1) Invoice Date and 2) Deduction Code in the WHERE statement. The results are returned to a table within the workbook. Since I will not be the end user and I do not want anyone messing with the WHERE statement, I want to use a cell in the workbook where the user can enter the Invoice Date and a Data Validation List cell where the Deduction Code can be selected. Both fields would act as parameters for the query.

I have tried to google this procedure but can't get exactly what I want to make it work. Any help or direction will be greatly appreciated.

Sam Ricca
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
here is a primer on parameter queries by our own MrE

 
Upvote 0
here is a primer on parameter queries by our own MrE

I'm not sure i can apply this to my situation. My source is a SQL query and not an Excel workbook. I am attaching my query that has 2 conditions. This query is loaded into Power Query and works perfectly to return data into an Excel table, however I must edit the code in Power Query to change the Deduction code and the Invoice date. I want to set parameters in cells in the workbook for those conditions to eliminate the need to edit them in power query. Your advice will be greatly appreciated.

Thanks,

Sam
 

Attachments

  • Union dues backup.jpg
    Union dues backup.jpg
    210.3 KB · Views: 35
Upvote 0
Bring your data into PQE as normal from SQL. In a spreadsheet, create your parameters as shown in the video and bring them into the PQE. Adjust your Mcode for the filtering based upon the parameters in the spreadsheet. Close and Load your mashed up data as you normally would. What you have shown is your SQL statement and not your Power Query Mcode. I have very limited SQL skills so I cannot help in changing that.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,150
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top