How to Create a Range in Tableau

Cody Schneider••7 min read

Looking at a wall of raw numbers, like sales figures for hundreds of individual transactions, can feel overwhelming. To find meaningful patterns, you need to group that data into understandable ranges, like "Small," "Medium," and "Large" deals. This article will show you two primary methods for creating custom numeric ranges in Tableau, so you can transform granular data into clear, actionable insights.

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

Why Group Data into Ranges in the First Place?

Before jumping into the "how," it's helpful to understand the "why." Continuous data, like sales amounts, customer age, or session duration, contains a unique value for almost every row. While accurate, this level of detail makes it hard to see the bigger picture. Grouping these numbers into ranges, or "bins," serves several important purposes:

  • Simplifies Analysis: It's much easier to compare the performance of 3-5 sales tiers than to analyze 5,000 unique transaction values. This simplification helps you spot trends and outliers more quickly.
  • Creates Histograms: The most common use for ranges is building histograms. A histogram is a bar chart that shows the frequency distribution of a measure. For example, you could create a histogram to see how many customers fall into different age groups (18-24, 25-34, 35-44, etc.).
  • Improves Readability: Dashboards that use well-defined ranges are often cleaner and easier for your audience to understand. Grouping data reduces visual clutter and focuses attention on the key segments that matter.

Imagine you have sales data for every single order. Instead of a messy table, you could create a simple bar chart that quickly answers an important question: "How many of our orders are high-value transactions versus small, everyday purchases?" This is the power of creating ranges.

Method 1: Using Bins for Equal-Sized Ranges

The quickest way to create ranges in Tableau is by using the built-in "Bins" feature. This method is perfect when you want to group your data into evenly sized intervals. For example, you could use bins to group customer ages into 10-year increments or sales amounts into $500 chunks.

Let's walk through an example using the Sales measure from Tableau's sample "Superstore" dataset. Our goal is to create a histogram showing the number of orders per sales range.

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 1: Create the Bins

First, find the measure you want to group in the Data pane on the left side of your worksheet. In this case, we'll use Sales.

  • Right-click on the Sales measure.
  • Navigate to Create > Bins...

This will open the "Create Bins" dialog box. Tableau automatically suggests a bin size for you, but you have full control to change it.

Step 2: Configure the Bin Size

In the dialog box, you'll see a field called "Size of bins." This is where you define the size of each range. If you set the size to 500, Tableau will create groups for $0-$499, $500-$999, $1000-$1499, and so on.

Let's set the Size of bins to 250. This will give us a more granular view of our small-to-mid-sized orders.

Once you've set the size, click OK. You will now see a new field in your Data pane called Sales (bin). Notice that the icon is a small histogram, indicating it's a numeric bin dimension.

Step 3: Build a Histogram with Your Bins

Now that you have your bins, you can use them to build a visualization.

  • Drag the Sales (bin) field from the Data pane onto the Columns shelf.
  • To see the count of orders for each bin, drag your unique identifier, like Order ID, to the Rows shelf.
  • By default, Tableau might use the Order ID as a dimension. We want a count, so right-click the Order ID pill on the Rows shelf and change it to Measure > Count (Distinct).

And just like that, you have a histogram! It shows the distribution of your orders across different sales thresholds, with most orders falling into the lower-value bins. You can now clearly see how many orders fall within the $0-$249 range, the $250-$499 range, and so on.

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

Method 2: Calculated Fields for Custom, Unequal Ranges

Tableau's bins feature is great for equal intervals, but what if you need custom, uneven ranges? For example, you might want customer segments defined as:

  • Bronze Tier: Sales under $50
  • Silver Tier: Sales between $50 and $500
  • Gold Tier: Sales over $500

You can't do this with standard bins because the intervals ($50, $450, and everything above) are not equal. This is the perfect use case for a calculated field using an IF statement. Calculated fields give you the ultimate flexibility to define ranges based on your unique business logic.

Step 1: Create a New Calculated Field

Navigate to the top menu and select Analysis > Create Calculated Field...

A new window will open where you can name your calculation and write your formula. Let's name this one "Sales Tier."

Step 2: Write the IF/ELSEIF Statement

We'll use a simple IF/ELSEIF/ELSE logic to assign a text label to each sales transaction based on its value. In the formula box, type the following:

IF [Sales] < 50 THEN "Bronze Tier"
ELSEIF [Sales] >= 50 AND [Sales] <= 500 THEN "Silver Tier"
ELSE "Gold Tier"
END

Let's break down this calculation:

  • IF [Sales] < 50 THEN "Bronze Tier": This first line checks if the sales value for a row is less than 50. If it is, Tableau labels it as "Bronze Tier."
  • ELSEIF [Sales] >= 50 AND [Sales] <= 500 THEN "Silver Tier": If the first condition isn't met, Tableau moves to this line. It checks if the sales value is between 50 and 500 (inclusive). If it is, the row is labeled "Silver Tier."
  • ELSE "Gold Tier": If neither of the first two conditions is met, the sale must be over 500. This line acts as a catch-all for every other possibility and labels it "Gold Tier."
  • END: This closes the IF statement.

Double-check that the calculation is valid (Tableau will tell you at the bottom of the window) and click OK. You'll now have a new dimension called "Sales Tier" in your Data pane.

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 3: Use Your New Custom Range in a View

This new calculated field behaves just like any other dimension. You can drag it into your view to slice and dice your data.

  • Drag "Sales Tier" to the Columns shelf.
  • Drag Sales to the Rows shelf. Tableau will default to SUM(Sales).
  • To further enhance the view, drag "Sales Tier" to the Color card in the Marks pane.

You've now created a bar chart showing the total sales generated by each tier. You've successfully converted a continuous measure (Sales) into a categorical dimension (Sales Tier) that tells a clearer story about your business.

Which Method Should You Use?

Deciding between Bins and Calculated Fields is straightforward:

  • Use Bins when you need to quickly group a continuous measure into ranges of equal size. It's fast, simple, and perfect for building histograms.
  • Use Calculated Fields when you need custom, unequal ranges defined by your specific business rules. This method offers total control and flexibility.

Final Thoughts

Mastering how to create ranges is a fundamental skill in Tableau that elevates your analysis from simply reporting raw data to providing insightful, segmented views. Whether you use the quick and easy Bins feature for even distributions or craft custom segments with Calculated Fields, you're better equipped to uncover the patterns hidden in your data and communicate them effectively.

Building these ranges and reports in a BI tool often involves a learning curve, with manual steps for creating bins and writing calculated fields. At Graphed, we created a way to skip these manual processes entirely. Instead of clicking through menus or writing formulas, you can simply ask for what you need in plain English. You could ask, "Show me the number of orders grouped by sales in $250 increments," and we would instantly build that histogram for you by connecting directly to your live data sources, giving you more time to analyze insights instead of preparing them.

Related Articles