10. Parameters in Power Query (and Other Kinds of Parameters)
10.1 What Is a Parameter and Why Use It?
In short: A Power Query parameter is a named, typed value that queries use instead of hard-coded text.
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, Solapur, 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 बदलकर देखो. ध्यान रखना!