Where Condition in Tableau?

Cody Schneider7 min read

Ever found yourself looking at a massive list of products, regions, or customers in Tableau and thinking, "I only want to see the ones that are actually performing well?" You don't want to pick them out by name, you want to set a rule - like showing only cities with sales over $50,000 - and let Tableau do the work. That's precisely where a Condition filter comes into play. This article will show you what a Condition filter is, when to use it, and how to set one up 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

What Exactly is a Tableau Condition?

In Tableau, a filter narrows down the data displayed in your visualization. A Condition, more specifically, is a type of filter that includes or excludes data based on a rule you define, almost always involving a measure. It’s part of the filtering options available for any dimension you place on the Filters shelf.

Think of it like being a bouncer at a club. You have a few ways to decide who gets in:

  • General Filter: You have a specific guest list. Only people named "John Smith" or "Jane Doe" are allowed in. This is like manually ticking boxes next to items you want to see.
  • Wildcard Filter: You have a rule to only let in people whose last name starts with "S." This is useful for text-based matching.
  • Top/Bottom Filter: You only let in the top 10 richest people in line. This is for ranking.
  • Condition Filter: You have a rule: only let people in who are carrying more than $100 in cash. The criteria isn't their name, it's a quantitative condition they must meet.

The Condition filter is your tool for that last scenario. It lets you filter a dimension (like Product Name, Customer Name, or City) based on the value of a measure (like Sales, Profit, or Quantity).

Why and When Should You Use Conditional Filters?

Conditional filters are incredibly powerful because they make your dashboards dynamic and focused on genuine business insights. Instead of displaying every single data point, you can isolate the ones that matter according to your business logic. They answer questions that require a performance threshold.

Here are a few common scenarios where a conditional filter is the perfect tool:

  • Finding Underperforming Products: You want to see a list of all products that generated less than $1,000 in sales last quarter.
  • Identifying Your Best Customers: You need to show only customers who have placed more than 5 orders.
  • Spotting Inefficient Campaigns: You want to highlight ad campaigns where the Cost Per Acquisition (CPA) was higher than $50.
  • Analyzing Regional Performance: You need a view of all sales regions that missed their profit target of 15%.

In each case, you're not interested in a static list. You want an ever-updating view that always reflects which items meet your pre-defined business rule.

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.

Step-by-Step Guide: Creating a Condition Filter in Tableau

Let's walk through a practical example using Tableau's sample "Super-Store" dataset. Our goal is to create a simple bar chart that shows sales by Sub-Category, but we only want to display Sub-Categories that have achieved more than $100,000 in total sales.

Step 1: Build Your Initial View

First, open Tableau and connect to the Super-Store data source. Create a simple bar chart to get started.

  1. Drag the Sub-Category dimension to the Rows shelf.
  2. Drag the Sales measure to the Columns shelf.

You should now see a bar chart showing the total sales for all 17 sub-categories, from "Tables" and "Chairs" at the top to "Fasteners" and "Labels" at the bottom.

Step 2: Add the Dimension to the Filter Shelf

We want to filter the list of Sub-Categories. To do this, drag the Sub-Category dimension from the Data pane onto the Filters card.

Step 3: Navigate to the Condition Tab

As soon as you drop 'Sub-Category' onto the Filters card, a pop-up window will appear. This dialog box has four tabs at the top: General, Wildcard, Condition, and Top. The "General" tab is selected by default, which lets you manually select sub-categories.

Click on the Condition tab.

Step 4: Define Your Condition

This is where you'll set up your rule. The Condition tab has two options: "By field" and "By formula." For this example, we'll use "By field."

You need to complete the sentence structure shown in the dialog:

  1. By field: In the first dropdown, select the measure your condition is based on. In our case, this is Sales.
  2. Aggregation: The middle dropdown asks how the measure should be aggregated. We want to evaluate the total sales for each sub-category, so we’ll leave it as Sum.
  3. Operator: In the next dropdown, choose the comparison operator. We want sales "greater than" our threshold, so select >.
  4. Value: Finally, in the text box, type your threshold value: 100000.

Your condition should now read: By field Sales Sum > 100000. This tells Tableau, "Only show the Sub-Categories where the Sum of their Sales is greater than 100,000."

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 5: Apply and Check Your View

Click the Apply button at the bottom right, and then click OK. Watch your worksheet. The bar chart instantly updates. All sub-categories with less than $100,000 in sales have disappeared, leaving you with just the top performers.

Going Deeper: Advanced Conditions with Formulas

Sometimes, your business rule is more complex than a simple measure comparison. For example, maybe you want to find all product sub-categories that have a poor profit ratio (e.g., less than 5%). This isn't a pre-existing field, it's a calculation.

This is where the By formula option in the Condition tab shines. It lets you write your own custom calculation for Tableau to use as the filter criteria. The formula must return a TRUE or FALSE value.

Let's try it. Drag Sub-Category to the Filters card again (or edit the existing filter). Go to the Condition tab and select the By formula radio button. In the text box, you could write:

SUM([Profit]) / SUM([Sales]) < 0.05

This formula calculates the profit ratio for each sub-category and checks if it's less than 5% (0.05). If the statement is true, Tableau will display that sub-category. If it's false, the sub-category will be hidden.

Common Pitfalls and Best Practices

Conditional filters are extremely useful, but it's easy to run into issues if you're not careful. Here are a few things to keep in mind:

1. Watch Your Aggregation

The aggregation method (SUM, AVG, MEDIAN, etc.) drastically changes the filter's behavior. A condition of SUM(Sales) > 5000 is very different from AVG(Sales) > 5000. Ensure you're evaluating the metric in a way that makes sense for your question.

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.

2. Use Parameters for Flexibility

Hardcoding values like "100000" into your filter works, but it isn't flexible. If you want to allow users to adjust the threshold themselves, use a parameter. You can create a parameter (e.g., "Sales Threshold") and then refer to it in your condition formula:

SUM([Sales]) > [Sales Threshold]

This turns your static report into an interactive analytical tool.

3. Understand the Order of Operations

Tableau applies filters in a specific order. If your conditional filter isn't behaving as you expect, especially when combined with other filters, you may need to learn about Tableau's Order of Operations and consider making one of your other filters a "Context Filter" to ensure it's applied before your condition.

Final Thoughts

Conditional filters are a fundamental technique for turning broad datasets into focused, actionable insights within Tableau. By filtering dimensions based on the performance of their measures, you can quickly find highlights, troubleshoot underperforming segments, and tell a much clearer story with your data. Spend some time practicing with them, and they'll quickly become a go-to tool in your analytics toolkit.

Mastering features like conditional formulas is essential in BI tools, but the learning curve can be steep for teams just starting out. That's a core reason we built Graphed. Instead of requiring you to learn special formulas and navigate filter menus, our platform allows you to create the same reports simply by describing what you need. A prompt like, "show me sub-categories with more than $100k in sales as a bar chart" instantly produces the visualization you need, connected directly to your source data. We handle the complex filtering in the background, so you can go from data to insight in seconds, not hours.

Related Articles