Parameters

Power BI · Getting Data

Theory

Power Query parameters are named values, such as a server name, file path, date or number, that queries can reference instead of hard-coded text. You create them in Manage Parameters, give each a name, type and current value, and then use the name in steps or in connector dialogs. Changing the parameter value changes every query that uses it.

For example, a parameter ServerName with value sql-dev-01 is used in Sql.Database(ServerName, "SalesDB"). When the report moves to production you change ServerName to sql-prod-01, either in Desktop or in the Service under the semantic model's settings, and all three tables now load from production. Parameters are also how incremental refresh works: it requires two Date/Time parameters named RangeStart and RangeEnd.

Why we use it

Hard-coded paths and server names make reports break when moving between developer machines and environments. Parameters put those values in one place so switching from Dev to Prod is a single change.

When to use it

Use parameters for anything that differs between environments or users: servers, databases, folder paths, row limits during development. They are not a replacement for report slicers, which filter data for viewers at run time.

How it works

  1. Value repeats in several queries
  2. Home → Manage Parameters → New Parameter
  3. Set name, type and current value
  4. Replace hard-coded text with the parameter
  5. Moving to another environment? Yes: Change the parameter value and refresh. No: Keep the current value.
  6. All dependent queries update together

Syntax

Home → Manage Parameters → New Parameter (Name, Type, Suggested values, Current value)
Use: in a connector dialog choose 'Parameter' instead of 'Text', or reference the name in M
Service: semantic model → Settings → Parameters

Example

// Parameter query 'ServerName' (created via Manage Parameters)
"sql-dev-01" meta [IsParameterQuery = true, Type = "Text", IsParameterQueryRequired = true]

// Sales query uses it
let
    Source = Sql.Database(ServerName, "SalesDB"),
    Sales = Source{[Schema = "dbo", Item = "Sales"]}[Data]
in
    Sales

// Deploying to Prod: change ServerName to "sql-prod-01"; Sales, Customers and Products all follow.

Key points

Power BI topics

Power BI Introduction

Getting Data

Power Query (Data Transformation)

Data Modeling

DAX (Data Analysis Expressions)

Data Visualization

Dashboards & Reports

Power BI Service

Advanced Features

Projects & Case Studies

Interview & Certification

Advanced DAX & Time Intelligence

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Power BI Dashboards & DAX

Learn data visualization and interactive dashboards step-by-step. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice DAX Online 250 business scenarios on a star schema — write a measure and compare your visual with the expected one. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Power BI  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax / Where to find it
{{ current.syntax }}
Example
{{ current.example }}
What You'll Learn — click to check off
  • {{ pt.mark }} {{ pt.text }}

Share this topic