10. Parameters in Power Query (and Other Kinds of Parameters)
10.2 Creating a Parameter (Manage Parameters Dialog)
Steps in Power BI
- Open the Power Query Editor › Home › Manage Parameters › New Parameter.
- Fill in the fields:
- Name:
ServerName(no spaces makes M code easier). - Description: "SQL Server for quick-commerce data" (shown as a tooltip).
- Required: ticked (the value cannot be empty).
- Type: Any, Text, Decimal Number, Date/Time, Date, Time, Date/Time/Timezone, Duration, True/False, Binary.
- Suggested Values: Any value, List of values (type allowed values, e.g. QCTEST01, QCSERVER01), or Query (a list query supplies the values).
- Default Value (for lists) and Current Value.
- Name:
- Click OK. The parameter appears in the Queries pane with a special icon and shows its current value.
- To change it later: select it in the Queries pane and edit Current Value, or in Report view use Home › Transform data › Edit parameters.
Parameter from a query
Create a list query, for example a blank query = {"Pune","Solapur","Nashik","Sambhaji Nagar","Kolhapur","Nagpur"}, or right-click a column › Drill Down to turn DarkStore[City] into a list. Choose Suggested Values › Query and pick it. The drop-down then nehmi matches your data.
Aata pudhe jaauya – ha parameter pratyakshat kuthe vaparaycha te baghu.
Ravindra Bagale's Tip
A common mistake is choosing the wrong parameter type, for example Text for a date limit. Pick the type that matches how it will be used (Date/Time for RangeStart, Text for a server name) and add Suggested values from a list when only a few values are valid. This matters for both exams and interviews.
Ravindra Bagale's Tip – मराठी
एक common चूक म्हणजे चुकीचा parameter type निवडणं, उदाहरणार्थ date limit साठी Text. तो कसा वापरला जाणार त्याला जुळणारा type निवडा (RangeStart साठी Date/Time, server name साठी Text) आणि फक्त थोड्याच values valid असतील तर list मधून Suggested values जोडा. हे exam आणि interview दोन्हीसाठी important आहे.
Ravindra Bagale's Tip – हिंदी
एक common गलती है गलत parameter type चुनना, जैसे date limit के लिए Text. वह जैसे इस्तेमाल होगा उससे मेल खाता type चुनो (RangeStart के लिए Date/Time, server name के लिए Text) और जब कुछ ही values valid हों तो list से Suggested values जोड़ो. यह exam और interview दोनों के लिए ज़रूरी है.