10. Parameters in Power Query (and Other Kinds of Parameters)
10.1 What Is a Parameter and Why Use It?
Start with a problem
Ravindra's folder path is different on his home PC and the training centre PC. Every query breaks when he changes PCs.
Explain simply
A parameter is a named value (like FolderPath) used in queries. Change it once, and all queries use the new value.
Show the data
| PC | FolderPath value |
|---|---|
| Home | C:\PBI\folder_orders |
| Training centre | D:\Class\folder_orders |
About this data: This table uses columns: PC, FolderPath value. This table uses columns: FolderPath, Rows, Total. This table uses columns: Parameter, Type, Example value, Used in. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).
Fictional sample data. Practice file: folder_orders/Orders_2026_04.csv, folder_orders/Orders_2026_05.csv (source: src/practice/).
Demonstrate
- Home › Transform data › Manage Parameters › New.
- Name
FolderPath, Type Text, Current valueC:\PBI\folder_orders. - Open the folder query's Source step.
- Replace the hard-coded path with
FolderPath. - Change the parameter value and refresh.
Show the result
Your result should look like this (fictional sample):
| FolderPath | Rows | Total |
|---|---|---|
| Home path | 8 | ₹2,100 |
| Training path | 8 | ₹2,100 |
Explain what happened
The Source step reads the parameter, so the same query works on both PCs.
Explore further
- Parameters also drive Dev/Prod servers and incremental refresh.
Detailed reference for this lesson:
A Power Query parameter is a named, typed value that queries use instead of hard-coded text. Examples in our project:
| Parameter | Type | Example value | Used in |
|---|---|---|---|
FolderPath |
Text | C:\QuickCommerce\Blinkit\ |
Folder connector (Module 7.20, 9) |
ServerName |
Text (list) | QCTEST01 / QCSERVER01 |
Sql.Database(ServerName, DatabaseName) |
DatabaseName |
Text | QuickCommerceDB |
SQL connection |
StartDate |
Date | 01-01-2025 | Filter orders from this date |
SelectedCity |
Text (list) | Pune, Mumbai, Nashik, Sambhaji Nagar, Kolhapur, Nagpur | A city-specific extract |
RangeStart / RangeEnd |
Date/Time | set by the Service | Incremental refresh (10.8) |
Simple bhashet sangaycha tar, benefits: one place to change a value, easy Dev/Test/Prod switching, reusable templates, and it is required for incremental refresh.
Ravindra Bagale's Tip
Friends, many students create parameters but never use them in the query, so changing the value does nothing. After creating a parameter, open the source step and replace the hard-coded text with the parameter name. Then change the value once to prove it works. Keep this in mind!
Ravindra Bagale's Tip – मराठी
मित्रांनो, बरेच students parameters बनवतात पण query मध्ये कधी वापरतच नाहीत, त्यामुळे value बदलून काहीच होत नाही. Parameter बनवल्यानंतर source step उघडा आणि hard-coded text च्या जागी parameter चं नाव टाका. मग ते चालतं हे सिद्ध करण्यासाठी एकदा value बदलून बघा. लक्षात ठेवा!
Ravindra Bagale's Tip – हिंदी
दोस्तों, बहुत से students parameters बनाते हैं पर query में कभी इस्तेमाल ही नहीं करते, इसलिए value बदलने से कुछ नहीं होता. Parameter बनाने के बाद source step खोलो और hard-coded text की जगह parameter का नाम डालो. फिर यह काम करता है यह साबित करने के लिए एक बार value बदलकर देखो. ध्यान रखना!
Fix common mistakes
| Wrong result | Reason | Correction |
|---|---|---|
| Path not found | Missing trailing folder or typo | Copy the path from File Explorer |
| Parameter not used | Source still hard-coded | Edit the Source formula |
| Type mismatch | Parameter type Any | Use Text |
Practise independently
Practice task
Where do you change the path when moving PCs?
Hints
- One place.
Solution
Only the FolderPath parameter value.
Think like a professional
Parameters make reports portable and deployable – a good interview point.
Revision card