Field Parameters
Power BI · Data Visualization
Theory
Field parameters let report readers choose which measure or column a visual uses. You create one with Modeling → New parameter → Fields, pick the fields to include, and Power BI generates a small calculated table plus a slicer. Put the parameter on a visual's axis or values, and when the reader picks an option in the slicer the visual switches to that field.
For example, a parameter 'Metric' with [Total Sales] and [Total Qty] placed in the X-axis of a region bar chart lets readers flip between sales (North ₹3,200, West ₹2,400, South ₹600) and quantity (North 6, West 3, South 1) without a second chart. A parameter of columns, such as Region, Category and City, lets them change how the chart is grouped. The generated table uses NAMEOF to reference each field, and the third value controls the order.
Why we use it
Without field parameters you need a separate visual or bookmark for every metric or grouping. Parameters keep the page clean and let readers explore on their own.
When to use it
Use them when readers ask for the same chart by different measures or dimensions. For a numeric 'what-if' input such as a discount percentage, use a numeric range parameter instead.
How it works
- Readers want one chart, many metrics
- Modeling → New parameter → Fields
- Choose the measures or columns to offer
- Place the parameter on the visual and add its slicer
- Reader picks an option? Yes: Visual switches to that field. No: Default field is shown.
- One flexible visual
Syntax
Modeling → New parameter → Fields → add fields → (Add slicer to this page)
Generated DAX:
Parameter = {
("Label", NAMEOF(<field>), <order>),
…
}Example
Metric = {
("Total Sales", NAMEOF('Sales'[Total Sales]), 0),
("Total Qty", NAMEOF('Sales'[Total Qty]), 1)
}
// Bar chart: Y-axis Sales[Region], X-axis Metric
// Slicer on Metric: choose 'Total Qty' → North 6, West 3, South 1Key points
- Created via Modeling → New parameter → Fields
- Can switch measures or columns in a visual
- Generates a calculated table using NAMEOF
- The third value in each row sets the display order
- Numeric range parameters are a different feature for what-if inputs