How to Bucket in Tableau
Transforming rows of raw data into a clear story is one of the most powerful skills in data analysis. One of the best ways to do this is by bucketing your data - a simple technique in Tableau that helps you group continuous numbers into neat, understandable categories. This article will show you exactly how to create these buckets, or "bins," to better visualize distributions, spot trends, and make your dashboards more intuitive.
What Exactly is Bucketing in Tableau?
Bucketing, also known as binning, is the process of grouping a continuous range of values into a smaller number of discrete "bins." Think of it like organizing a massive pile of coins. Instead of dealing with 2,457 individual pennies, 1,043 nickels, and 876 dimes, you group them into buckets: a bucket for pennies, a bucket for nickels, and so on. In Tableau, you do the same thing with numerical data.
For example, instead of analyzing a list of 5,000 individual customer ages (21, 45, 33, 67, 28...), you can bucket them into T-shirt sizes:
- Age Group 1: 20-29
- Age Group 2: 30-39
- Age Group 3: 40-49
This process transforms a continuous measure (like Age) into a helpful dimension (like Age Group). Suddenly, your scattered data points become a clean, manageable set of categories you can use to build histograms, bar charts, and other visualizations. This simplification makes it much easier to see the overall shape and distribution of your data, answering questions like, "Which age group represents our largest customer base?"
When Should You Use Bucketing? Practical Scenarios
Bucketing isn't just a technical exercise, it's a practical tool for solving real business problems. It helps you zoom out from the individual data points to see the bigger picture.
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.
1. Analyze Sales Performance by Deal Size
Instead of looking at a long list of individual sale amounts, you can bucket them to understand your sales pipeline better.
- $0 - $1,000 (Small Deals)
- $1,001 - $5,000 (Medium Deals)
- $5,001 - $20,000 (Large Deals)
- $20,001+ (Enterprise Deals)
This helps you quickly see what percentage of your revenue comes from small versus large deals and where your sales team is focusing its efforts.
2. Understand Website User Engagement
If you're using Google Analytics data in Tableau, you might have a field for "Session Duration" in seconds. Analyzing thousands of individual session times isn't very helpful. Instead, you can create buckets:
- 0 - 10 seconds (Bounced)
- 11 - 60 seconds (Brief Engagement)
- 61 - 180 seconds (Engaged)
- 181+ seconds (Highly Engaged)
This bucketing highlights your site's stickiness and shows you how many users fall into each engagement category.
3. Segment Customers by Purchase Price
For an e-commerce store, a list of product prices can be overwhelming. Binning these prices helps you analyze which price points are most popular.
- $0 - $25
- $25.01 - $50
- $50.01 - $100
- $100.01+
This allows you to see the distribution of products sold across different price tiers, helping you with pricing strategy and inventory planning.
How to Create Bins Automatically in Tableau
Tableau makes it incredibly simple to create evenly sized bins directly from a measure. This is the fastest way to build a histogram and understand the distribution of your data.
Let's use an example. Imagine you have sales data and want to analyze the distribution of Sales amounts per order.
Step 1: Locate Your Measure
In the Data pane on the left side of your Tableau screen, find the continuous measure you want to group. In our case, it’s the Sales field.
Step 2: Create the Bins
Right-click on the Sales measure. From the context menu, navigate to Create > Bins....
Step 3: Configure Your Bin Size
A dialog box will pop up, allowing you to define your bins. Here’s what the options mean:
- New field name: Tableau automatically suggests a name, like
Sales (bin). You can leave it as is or change it to something more descriptive. - Size of bins: This is the most crucial setting. It defines the interval for each bucket. For example, if you set the size to
250, Tableau will create bins for $0-$250, $250-$500, $500-$750, and so on. Tableau often suggests a size based on your data's range, which is a great starting point.
Click OK. Tableau has now created a new dimension in your Data pane called Sales (bin). You'll notice it has a small histogram icon next to it, indicating it's a binned field.
Step 4: Visualize Your Bins
Now comes the fun part. Let's create a histogram:
- Drag the new
Sales (bin)dimension from your Data pane onto the Columns shelf. - Drag the measure you want to count - for instance,
Order ID- onto the Rows shelf. Right-click it and change its aggregation to Measure (Count) or Measure (Count Distinct). This will tell you how many orders fall into each sales bucket.
And just like that, you have a histogram showing the distribution of your order values. You can now instantly see if you have a lot of small orders, a few very large ones, or an even spread.
How to Create Custom Buckets with Irregular Sizes
Tableau’s automatic binning feature is fantastic, but it has one limitation: every bin has an equal size. What if you need custom, irregular-sized groups? For a sales analysis, you might want these categories:
- Small Sale: < $100
- Medium Sale: From $100 to $999
- Large Sale: Anything $1,000 and over
These buckets are not evenly sized. For this scenario, you'll need to use a Calculated Field.
Step 1: Create a Calculated Field
At the top of the screen, go to Analysis > Create Calculated Field... Or, click the dropdown arrow at the top of the Data pane and select Create Calculated Field....
Step 2: Name Your Calculation
Give your new field a descriptive name, like "Deal Size Tier."
Step 3: Write the Grouping Logic
Here you'll use a simple IF/ELSEIF statement to define your custom groups. This logic tells Tableau which bucket to place each record into based on its sales value.
In the formula editor, type the following:
IF [Sales] < 100 THEN "Small Sale"
ELSEIF [Sales] < 1000 THEN "Medium Sale"
ELSE "Large Sale"
ENDThis code checks the Sales value for each row. If it's less than 100, it's a "Small Sale." If not, it checks if it's less than 1,000 and labels it a "Medium Sale." Anything else automatically becomes a "Large Sale."
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 4: Use Your Custom Dimension
Click OK. Your new "Deal Size Tier" dimension will appear in the Data pane, ready to use.
You can now drag "Deal Size Tier" onto the Columns shelf and COUNT(Order ID) onto the Rows shelf to see how many orders fall into your custom-defined small, medium, and large categories. You can also drag the Sales measure itself onto the Color or Label cards to add more context.
Best Practices for Bucketing Data in Tableau
To get the most out of bucketing, here are a few simple tips to keep in mind:
- Start with the "Why": Before creating your bins, ask yourself what question you're trying to answer. Are you looking for distribution? Outliers? This will help you decide on the right bin size or the right custom logic.
- Experiment with Bin Size: Finding the perfect bin size is more of an art than a science. Too small, and your chart will be overly detailed and noisy. Too large, and you risk masking important trends. Use Tableau's "Suggest Bin Size" as a starting point and don’t be afraid to adjust it until the story in your data becomes clear.
- Use Descriptive Names: Whether you're using automatic bins or a calculated field, give your fields and categories intuitive names. "Sales Group 1" is less helpful than "Under $100."
- Combine Bins with Other Dimensions: Bucketing becomes even more powerful when you combine it with other data. For example, after creating your sales bins, drag the
Regiondimension to the Color mark to see if the distribution of deal sizes is different in the East versus the West.
Final Thoughts
Bucketing data is a fundamental technique for any Tableau user. Whether you use the quick built-in binning feature to create histograms or write a custom calculated field for tailored groupings, the goal is the same: to turn granular data into meaningful insights. Mastering this skill helps you simplify complexity, tell clearer visual stories, and uncover patterns you might have otherwise missed.
Building dashboards manually, writing formulas, and configuring bins in tools like Tableau can take time away from actually analyzing your data. At Graphed, we streamline this entire process for marketing and sales data. We built an AI data analyst that allows you to connect your sources - like Google Analytics, Shopify, or Salesforce - and create visualizations just by asking questions in plain English. Instead of building buckets, you can simply ask, "Show me a chart breaking down our Shopify orders by size," and get an instant, real-time analysis.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.