Just Learn Code

Mastering Data Analysis with Tableau: Understanding and Using Bins

Tableau is a powerful data visualization and analysis tool used by businesses worldwide to create interactive dashboards and charts that help organizations make data-driven decisions. Tableau offers a wide range of features and functions that can be used to explore data, analyze trends, and communicate insights.

One of the most useful features of Tableau is the ability to group data points into bins. In this article, we will explore what Tableau bins are, how to use them, and their various types.

Understanding Tableau Bins

Bins are groups of data points that are categorized based on specific criteria. In Tableau, bins are used to segment continuous data, such as sales figures, into distinct groups.

Bins can be created for any numeric field in a dataset, including values such as age, sales, and profit. The resulting categories are represented by colored bars in a chart, making it easy to compare the values of different groups.

Types of Data Grouping and Bins Creation

Tableau provides several different methods of grouping data points. At a basic level, data can be grouped by dimensions or measures.

Dimensions are qualitative variables such as geographic location, product type, or date, whereas measures are quantitative variables such as sales, profits, or cost. When creating bins, the focus is on grouping data points by measures.

To create a set of bins in Tableau, you will need to select the field you wish to group. This can be done by dragging the required field onto the Rows or Columns shelf.

From there, you can select the “Create Bins” option from the drop-down menu, and Tableau will create bins that group the data into categories based on the parameters you specify. Example using SalesData.csv

To demonstrate how bins work in Tableau, let us consider an example of an office supplies company that wants to understand their total sales figures better.

We will use the SalesData.csv dataset, which contains information about sales for different products and regions. The first step is to open the file in Tableau, drag the Total Sales field onto the Rows shelf, and select “Create Bins.” This will bring up the Edit Bins window, where you can set the size of the bins.

One helpful feature is the “Suggest Bin Size” option, which recommends an optimal bin size based on the dataset’s distribution. In our example, Tableau suggests a bin size of $2195.72, which seems like a reasonable choice.

Creating Bins for a Field in Tableau

Now that we understand what bins are and how useful they can be, let us explore how to create bins for a field in Tableau.

Steps to Create Bins for a Field

1. Open the dataset containing the field you wish to bin, and select the field.

2. Drag the field onto the Rows or Columns shelf.

3. Select “Create Bins” from the drop-down menu.

4. Set the size of the bins in the Edit Bins window.

5. Click “OK,” and the bins will be created.

Edit Bins Window and Setting Options

The Edit Bins window is where you can customize the bin size and set other options. The main options include:


Size of bins: This option sets the size of each bin. You can either select a fixed bin size or allow Tableau to recommend an optimal size.

2. Number of bins: This option sets the number of bins you wish to create.

If you select this option, Tableau will automatically calculate the optimal bin size based on the field’s range. 3.

Start and end points: These options let you specify the minimum and maximum values for the bins. This can be useful when working with data that has outliers or extreme values.

Suggest Bin Size Feature and Calculation Formula

The “Suggest Bin Size” feature is a useful tool for determining the optimal bin size based on your dataset’s distribution. This feature uses a calculation formula that takes into account the field’s range, skewness, and kurtosis.

The formula used by Tableau is:

Bin Width = (2 * Interquartile Range) / (N^(1/3))

Where N is the number of data points and the Interquartile Range is the range between the first and third quartiles. This formula ensures that the bin widths are consistent and appropriate for the data distribution.


In conclusion, bins are an essential feature of Tableau that allow users to categorize and group continuous data into distinct categories. Bins can be useful in analyzing trends and patterns in data and can be used with various data formats, including age and revenue.

Understanding how to create bins and the different types of data grouping can help businesses make data-driven decisions and create insightful visualization of datasets. By mastering this functionality, analysts can use Tableau to explore, analyze, and communicate data insights to better inform business decisions.

Using Bins in Tableau Sheets

Now that we’ve explored what bins are and how to create them in Tableau, it’s time to dive deeper into using bins in our Tableau sheets. In this section, we’ll cover how to incorporate bins into a Tableau sheet, how to adjust the bin size, and how to identify empty ranges in our bins.

Incorporating Bins into a Tableau Sheet

Once you’ve created your bins, the next step is to incorporate them into your Tableau sheet. This can be done by dragging the measure field onto the view and then dragging the bin field onto the same view.

You should see a histogram chart, with each bar representing a bin. Let’s take our SalesData.csv example from the previous section, where we created bins for Total Sales.

To incorporate these bins into our Tableau sheet, we would drag the Total Sales measure onto the Columns shelf. Then, we would drag the Total Sales (bin) field onto the same shelf.

The resulting chart would show the distribution of sales across each bin.

Bin Size and Value Count

In the Edit Bins window, you can adjust the bin size to create larger or smaller bins. The optimal size depends on the data distribution.

If the bin size is too small, there may not be enough data points in each bin to make meaningful comparisons. If the bin size is too large, the resulting bins may be too broad, and details may be lost.

Additionally, understanding the value count for each bin can help you identify trends in your data. If a particular bin has a high value count, it may represent an area of interest that requires further investigation.

On the other hand, if a bin has a low value count, it may represent an outlier or an area of lower priority. In our SalesData.csv example, we created bins with a suggested bin size of $2195.72.

However, we might want to experiment with different bin sizes to better understand the sales distribution. For instance, if we adjust the bin size to $1500, we can see that several smaller bins have emerged, indicating a more detailed breakdown of our data.

Alternatively, if we set our bin size to $5000, we see just a few broader bins in the chart. We can experiment with these adjustments to see how they affect our analysis of the data.

Identifying Empty Ranges in Bins

Empty ranges occur when there are no data points in a particular bin. Identifying and understanding empty ranges is an essential part of data analysis, as they can help us identify critical data gaps or anomalies.

In Tableau, empty ranges can be seen as gaps in the bar chart representation of bins. In our SalesData.csv example, we can look for empty ranges in the chart by examining the x-axis.

Any missing bins in the chart indicate that there are no data points in that range. For example, in the $3000-4000 bin, there are no sales, and so there is an empty range.

Identifying and understanding these empty ranges can help us understand the distribution of our data and potential areas of interest. Overall, understanding how to use bins in Tableau sheets is a crucial skill for data analysis and visualization.

By incorporating bins into our charts, adjusting bin size, and identifying empty ranges, we can gain valuable insights and identify key trends and patterns in our data. With this knowledge, we can create more sophisticated dashboards and reports, allowing businesses to make data-driven decisions and gain a competitive edge.

In summary, this article explored the concept of bins in Tableau, discussing the definition and function of bins, types of data grouping and the creation of bins using the SalesData.csv example. We then went on to discuss how to create bins for a field in Tableau, including the steps involved and the options available in the Edit Bins window.

Finally, we explored how to use bins in Tableau sheets, adjusting the bin size, identifying empty ranges, and using value counts to gain valuable insights into data trends and patterns. By mastering the use of bins in Tableau, businesses can make data-driven decisions and gain an edge in today’s competitive market.

Popular Posts