How to Pass Slicer Value to Parameter in Power BI

Cody Schneider••7 min read

Passing a slicer value directly to a parameter in Power BI transforms your static reports into dynamic, interactive tools. Instead of just filtering data, you can empower users to conduct their own "what-if" analysis or even change query behavior right from the report canvas. This article will show you exactly how to set up and use this powerful feature step-by-step.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

First, A Quick Refresher: Parameters vs. Slicers

Before connecting them, it's helpful to understand the distinct roles parameters and slicers play in Power BI.

A Slicer is a simple, on-canvas visual that filters the data presented in other visuals on the report page. If you have a slicer for "Region," selecting "North America" will filter your charts and tables to show data only for that region. It’s a straightforward filtering tool.

A Parameter, on the other hand, is a placeholder or a variable that can hold a value. You can use parameters in DAX measures, calculated columns, or in Power Query to make your data transformations dynamic. Their real power is in their flexibility, they aren't tied to a single column or filter context.

Combining the two allows the end-user's selection in a slicer to feed a value into that flexible parameter, unlocking powerful analytical capabilities.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Why Pass a Slicer Value to a Parameter?

Connecting a slicer to a parameter opens up a world of possibilities for more engaging and insightful reports. Here are a few common use cases:

  • "What-If" Analysis: This is the most popular use case. Users can use a slicer to "test" different scenarios. For example, they could adjust a "Projected Sales Growth" slider from 5% to 25% and instantly see how it impacts forecasted revenue, profit margins, and inventory needs.
  • Changing Calculation Logic: Allow users to switch between different calculations. A slicer could control a parameter that dictates whether a chart shows total sales by value or by unit count.
  • Dynamic TOP N Filtering: Instead of a static "Top 10 Products" report, let users decide if they want to see the Top 5, Top 10, or Top 20 products using a simple slicer that feeds a parameter.
  • Optimizing Performance on Massive Datasets: For very large direct query sources, you can bind a slicer to a Power Query parameter. This allows the slicer to filter the data at the source before it's even loaded into the Power BI model, significantly improving report performance.

Step-by-Step Tutorial: Creating a "What-if" Parameter for Sales Forecasting

Let's walk through the most common scenario: creating a what-if parameter to forecast sales growth. Imagine we have a basic sales report and want to add a slicer that lets managers see how a potential percentage increase in sales would affect the bottom line.

Step 1: Create a Numeric Range Parameter

Power BI has a built-in feature specifically for creating what-if parameters that are instantly linked to a slicer.

  1. In Power BI Desktop, navigate to the Modeling tab on the ribbon.
  2. Click on the New parameter icon and select Numeric range.
  3. A configuration window will appear. Let's fill it out for our sales forecast:
  4. Make sure the Add slicer to this page box is checked.
  5. Click Create.

What just happened? Power BI did two things automatically:

  • It created a new calculated table named Sales Growth Forecast % with a single column that contains a list of values from your minimum (-0.20) to your maximum (0.50), based on the increment you set.
  • It created a DAX measure called Sales Growth Forecast % Value which will capture the single value selected in the slicer. The DAX for this measure is:

You'll also see a new slicer appear on your report canvas, showing the range you defined.

Step 2: Use the Parameter in a New Measure

Now that we have our variable, we need to use it in a calculation. We'll create a new measure for our forecasted sales.

  1. In the report view, right-click on your main data table (e.g., Sales) and select New Measure.
  2. Enter the following DAX formula in the formula bar:

Forecasted Sales = SUM(Sales[Total Revenue]) * (1 + 'Sales Growth Forecast %'[Sales Growth Forecast % Value])

  1. Press Enter.

This formula takes the sum of your existing Total Revenue and multiplies it by a growth factor. The (1 + 'Sales Growth Forecast %'[Sales Growth Forecast % Value]) part does the magic. If you select 10% (0.10) in the slicer, this part becomes (1 + 0.10), or 1.10, effectively increasing your total revenue by 10%.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Step 3: Visualize the Results

The final step is to add this new measure to your report so you can see the effect of the slicer.

  1. Add a Card visual to your report. Drag your new Forecasted Sales measure into it.
  2. Add another Card visual and drag your original Total Revenue measure into it for comparison.
  3. Now, interact with the Sales Growth Forecast % slicer you created. As you move the slider or change the numeric input, you’ll see the Forecasted Sales card update in real-time.

You have successfully passed a slicer value to a parameter to perform a dynamic what-if calculation!

Advanced Use Case: Binding a Slicer to a Power Query Column

What if you want a slicer to filter your data at the source? This technique is ideal for large datasets because it reduces the amount of data Power BI has to load and process. To do this, you first need to enable the preview feature.

Enable the "Dynamic M query parameters" Feature

  1. Go to File > Options and settings > Options.
  2. In the Global section, click Preview features.
  3. Check the box for Dynamic M query parameters and click OK. You'll need to restart Power BI Desktop.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Steps to Bind a Slicer to a Query Parameter

Imagine you have a huge sales database and want users to be able to select a single country to analyze without loading the entire world's data.

  1. Create the Query Parameter: In the Power Query Editor (Home > Transform data), go to Manage Parameters > New Parameter. Create a parameter named SelectedCountry with a type of Text and a current value of 'USA'.
  2. Filter Data with the Parameter: In your main sales table query, select the Country column's filter dropdown, go to Text Filters, and choose Equals. In the dialog box, change the filter dropdown from 'Text' to 'Parameter' and select your SelectedCountry parameter. Click OK. Now the query only pulls data for 'USA'.
  3. Create a Slicer Values Table: Back in the main Power BI window, you need to create a table that contains the list of all possible countries for your slicer. Use the following DAX to create a new calculated table:

Country Slicer Table = DISTINCT(YourSalesTable[Country])

Important: Make sure the original YourSalesTable query loaded all countries before you applied the parameter filter in Power Query, otherwise this DISTINCT list will be incomplete.

  1. Bind the Column to the Parameter:
  2. Create the Slicer: Go back to the report view, add a slicer visual, and drag the Country field from your Country Slicer Table into it.

Now, when a user selects "Canada" from the slicer, Power BI sends "Canada" to the SelectedCountry parameter, re-runs the Power Query, and queries the database for just Canadian sales data. This is an incredibly powerful way to optimize performance.

Final Thoughts

Learning how to pass slicer values to parameters unlocks a deeper level of interactivity and analytical power in your Power BI reports. Whether you're enabling users to explore future scenarios with what-if analysis or optimizing performance on massive datasets, this technique elevates your reports from simple data displays to sophisticated analytical tools.

Ultimately, a good report is one that helps people get clear answers quickly. While tools like Power BI are incredibly powerful, there's often a learning curve to mastering features like these. With Graphed, we aim to eliminate that friction completely. We built our product so you can connect all your sales and marketing data sources, then create dashboards and get insights simply by asking questions in plain English. Instead of figuring out DAX or parameter binding, you can just ask, "Show me my forecasted sales if we increase ad spend by 15% next month," and get an answer in seconds.

Related Articles