How to Combine Two Parameters in Tableau
Combining two or more parameters in Tableau is one of the best ways to transform a static report into a truly interactive dashboard. Rather than directly merging them, the real technique involves using calculated fields to make multiple parameters work together. This guide will walk you through exactly how to set up and combine parameters to give your users powerful, flexible controls for slicing and dicing their data.
What Are Tableau Parameters and Why Combine Them?
First, let's quickly recap what a parameter is. A parameter in Tableau is a user-defined input that acts as a placeholder. Think of it as a variable you can change, like a dropdown menu, a slider, or a text box. Unlike a filter, a parameter doesn't do anything on its own. It only becomes useful when you reference it in a calculated field, a filter, or a reference line.
The magic happens when you combine two or more of these placeholders. Why would you want to do this? Combining parameters opens the door to creating sophisticated "what-if" analyses and highly customized user experiences. Here are a few common scenarios:
- Multi-Condition Filtering: Allow users to filter a view based on multiple criteria at once. For example, they might want to see all orders from a specific Region (Parameter 1) that are above a certain Sales Value (Parameter 2).
- Dynamic "What-If" Scenarios: Let users model outcomes. For instance, they could adjust a hypothetical Discount Rate (Parameter 1) and apply it only to a chosen Product Category (Parameter 2) to see the potential impact on overall profit.
- Advanced Swapping: You could link a parameter that swaps the measure being displayed (e.g., Sales vs. Profit) to another parameter that swaps the dimension on the axis (e.g., viewing by Region vs. Category). This turns one chart into many, saving valuable dashboard space.
The core concept you need to remember is this: We combine parameters using calculated fields. The calculated field acts as the bridge, housing the logic that checks the values of multiple parameters simultaneously and tells Tableau how to update the view.
Method 1: Combining Parameters for Multi-Condition Filtering
Let's walk through the most common use case: creating a view that filters data based on two separate user inputs. For this example, we’ll use Tableau’s Superstore sample dataset. Our goal is to create a bar chart showing Sub-Category sales, but we want the user to be able to filter for a specific Category and a minimum Sales threshold.
Step 1: Create the Visualization Foundation
First, build the basic chart. This provides the canvas for our parameters to act upon.
- Connect to the Sample - Superstore data source.
- Drag Sales to the Columns shelf.
- Drag Sub-Category to the Rows shelf.
- Sort the chart in descending order for readability.
You should now have a simple horizontal bar chart displaying total sales for each sub-category.
Step 2: Create the First Parameter (Category Selection)
Now, let's create a parameter that lets the user choose a product category.
- In the Data pane on the left, click the small dropdown arrow next to the search bar and select Create Parameter....
- Name the parameter p.SelectCategory. A good practice is to prefix parameter names (e.g., with "p.") to distinguish them from your data fields.
- Set the Data type to String.
- Under Allowable values, choose List.
- To save time, click Add Values from > Category. This will automatically pull in "Furniture," "Office Supplies," and "Technology."
- It's also great practice to add an "All" option so the user can easily see everything. Click Add and type in a new value: All. This will serve as our "reset" button.
- Click OK.
You'll see p.SelectCategory appear in the Parameters section at the bottom of the Data pane. As mentioned, it won't do anything yet.
Step 3: Create the Second Parameter (Sales Threshold)
Next, let's create a parameter for our minimum sales value. This will let users filter out smaller sales amounts to focus on larger ones.
- Right-click in the Data pane and select Create Parameter... again.
- Name this one p.SalesThreshold.
- Set the Data type to Integer. This is because we are comparing it to whole dollar amounts.
- For Allowable values, select Range.
- Set the range values. For this data, a Minimum of 0 and a Maximum of 10,000 makes sense. A Step size of 500 means the slider will jump in increments of 500.
- Click OK.
Step 4: Create the Calculated Field to Combine Them
This is where it all comes together. We need to write a single calculation that references both parameters and tells Tableau what to do.
- Right-click in the Data pane and select Create Calculated Field....
- Name it c.CombinedFilter. Prefacing calculated fields with "c." is another helpful organizational habit.
- Enter the following formula:
( [Category] = [p.SelectCategory] OR [p.SelectCategory] = 'All' )
AND
SUM([Sales]) >= [p.SalesThreshold]- Click OK.
Let's break down this calculation. It performs two checks and returns a value of either TRUE or FALSE:
( [Category] = [p.SelectCategory] OR [p.SelectCategory] = 'All' ): This part checks if the Category field from our data matches the category the user selected in our parameter. TheORcondition handles our "All" option, making the filter true for every category if "All" is selected.SUM([Sales]) >= [p.SalesThreshold]: This part checks if the aggregated Sales for a given mark (in our case, for each Sub-Category bar) are greater than or equal to the value selected in our sales slider. We useSUM()because [Sales] is being aggregated on our visualization.
The AND operator is the key. It ensures that both the category condition and the sales threshold condition must be met for the final result to be TRUE.
Step 5: Apply the Filter and Show the Controls
Now, we just need to use our calculated field and make the parameters visible to the user.
- Drag your new calculated field, c.CombinedFilter, from the Data pane onto the Filters shelf.
- A dialog box will appear. Select True and click OK. This tells Tableau to only keep the rows of data (the Sub-Categories) where our combined logic is met.
- In the Data pane, right-click on p.SelectCategory and choose Show Parameter.
- Do the same for p.SalesThreshold and choose Show Parameter.
You'll now see two interactive controls on the top right-hand side of your view. Go ahead and test them! Select "Technology" from the dropdown and watch the chart update to show only technology sub-categories. Then, slide the sales threshold up to 2500 and see how the list narrows further. Pick "All" to see all categories again, still subject to the sales threshold. You've successfully combined two parameters!
Method 2: Dynamically Swapping a Measure and Filtering a Dimension
Let's try a different challenge that combines a text parameter with another text parameter. In this scenario, we want to allow the user to select which measure to view (e.g., Sales, Profit, or Quantity) using one parameter and simultaneously filter by shipping mode using another parameter. This technique lets you build extremely space-efficient dashboards where one chart can answer many different questions.
Step 1: Set Up the Base Chart
Let's make a simple time-series chart. Drag Order Date to Columns (and set to MONTH) and Sales to Rows.
Step 2: Create a Parameter to Swap the Measure
- Create a new String parameter named p.SelectMeasure.
- Provide it with a List of allowable values with the exact strings you want users to see: "Sales," "Profit," and "Quantity".
Step 3: Create a Calculated Field for the Measure Selector
This calculated field uses its parameter's current value to decide which measure to return.
- Create a new calculated field called c.DynamicMeasure.
- Use a CASE statement for clean logic:
CASE [p.SelectMeasure]
WHEN "Sales" THEN SUM([Sales])
WHEN "Profit" THEN SUM([Profit])
WHEN "Quantity" THEN SUM([Quantity])
ENDNow, replace the SUM([Sales]) on your Rows shelf with your new c.DynamicMeasure calculated field. You can now switch between measures using the parameter.
Step 4: Create the Parameter to Filter by Ship Mode
Create a String parameter named p.SelectShipMode and populate it with the possible shipping modes, ensuring you also include an "All" option to allow for viewing all modes.
Step 5: Create the Calculated Field to Combine Parameters
Set up a calculated field named c.ShipModeFilter.
- Use the following formula:
CASE [p.SelectShipMode]
WHEN "All" THEN [Ship Mode]
WHEN "First Class" THEN [Ship Mode]
WHEN "Second Class" THEN [Ship Mode]
WHEN "Standard Class" THEN [Ship Mode]
ENDThis calculation checks whether the user-selected Ship Mode matches the data or if "All" is selected, allowing all data to be shown.
Step 6: Apply the Filter and Show the Controls
Drag the c.ShipModeFilter to the Filters shelf and choose True to filter the data based on your parameter. Show your p.SelectShipMode parameter control to make it visible to users.
Final Thoughts
Combining parameters in Tableau using calculated fields is a game-changer. It enables you to create sophisticated interactive dashboards that are intuitive and insightful. By mastering this skill, you're equipping yourself to make the most of Tableau's powerful features to elevate your data analytics capabilities. For more resources on enhancing your Tableau expertise, try Graphed, where you can find tools and courses to help you explore the full potential of data visualization.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?