Recently, while analysing Sales data in Tableau, I wanted to see how many customers are in different purchase ranges, such as small buyers, medium buyers, and high-value customers. Initially, I attempted to filter and group them manually, using the calculated fields.
Then, I discovered a straightforward solution to categorise the measures into equal-sized ranges using the Tableau Bins feature.
In this Tableau tutorial, I will explain how to create bins in Tableau using examples. Additionally, I will explain how to dynamically update the field bin size.
What are Bins in Tableau?
In Tableau, bins are pre-defined, equal-sized ranges or “buckets” used to group a continuous measure into discrete categories for analysis and visualisation.
By creating bins, users can organise large datasets and trends, and create histograms to simplify complex data into distributions, such as grouping sales data into intervals like $0-$999, $1,000-$1,999, and so on.
Create Bins in Tableau
In the examples below, we will create bins in Tableau measure fields for different use case scenarios.
Example-1: Create Sales Bins in Tableau
In this example, we will create bins in the Sales measure to categorise customer purchase ranges.
Now, connect the Tableau with the dataset and follow the steps below to create bins.
- To create bins in Sales measure, go to the Data pane and select Sales -> Create -> Bins.

- In this step, enter the label for the bin field. After this, enter the size of the bins. For example, if we take the bin size as 1000, then the size will be divided as 0-1000, 1000-2000 and so on.
After defining the size of bins, click OK.

- To create the view, add the Sales bin to the Columns and records to the Rows.
- In this example, we will show the number of customers under a specific sales bin size. For this, click on the Customer Name in the Rows and select Measure ->Count.

- Now, change the Marks type to Bar. After this, press “Ctrl” and drag Customer Name (Count) to the Label card in the Marks section.

With this, we can see a histogram chart showing each bin with a 1K range. In all bins, we can see the number of customers who have sales in the specific range.
Example-2: Create Profit Bins in Tableau
In this example, we will create bins for the Profit measure field. Using this bin, we can categorise Loss and Profit segments.
Now, follow the steps below to create a bin for the Profit field in Tableau.
- In the Data pane, click on the Profit field and select Create -> Bins.

- Enter the label for the bin field, and define the range for the bins. In this example, I have defined the range of profit bins as 1000, which will distribute the bins as 0-1000, 1000-2000 and so on.
After defining the bin range, click OK.

- To create the chart view, drag the Profit bin to the Columns and Customer Name to the Rows.
- To display the count of customers in each bin, change the customer name from discrete to continuous. For this, click on the Customer Name in Rows and select Measure -> Count.
- Now, to show the loss and profit values on either side, click on the Show Me tab and select Histogram chart.

With this, we can see the number of customers in each bin where the range of profit is 500.
This way, we can create Profit beans in Tableau by following the above steps.
Dynamically Change Bin Size in Tableau
In Tableau, we can also change the bin size dynamically using a parameter. This parameter will have an input field, in which we can enter the bin size that will change dynamically on the chart.
In this example, I will use the Proft bin that we have created in the example above.
- To create a parameter, click on the dropdown in the Data pane and select Create Parameter.
- Define the details below to create the parameter that will control the bin size dynamically.
- Enter the Name as Profit Bin Size.
- Select the Data type as Integer.
- The current value will be the size of the bin that will change dynamically.
- Select the Minimum and Maximum values of the Range.
- At last, select the Step size for the bins and click OK.

- Open the bin field Profit(bin) in the edit window, and in Value select the parameter Profit bin Size that we have created and click OK.

- In the Data pane, click on the parameter Profit Bin Size and select Show parameter. With this, the parameter will be visible on the sheet through which we can update the bin size.

Now, we can see the parameter on the worksheet and in the input value, we can update the new bin size. As we change the bin size, it will also reflect in the chart.

This way, we can dynamically update the bin size values in Tableau.
Conclusion
In this Tableau tutorial, we have learned how to create bins in Tableau for different use cases like categorising Sales ranges and separating Profit and Loss values. We also learned how to dynamically update the bin size using parameters to change its size.
By using bins, we can group continuous data into ranges, build histograms, and define distributions to analyse the data in Tableau.
You may also like to read:
- Use Context Filters in Tableau
- Create a Set in Tableau
- Create a Table in Tableau
- Repeat Row Labels in Tableau
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.