What is Tableau Histogram?
Tableau Histogram is a data visualization tool that displays the distribution of underlying data. It resembles a bar chart and is displayed as a series of connected data bars. A histogram divides the single continuous measures into ranges or bins that represent a specific range of values. These data points are then further grouped into equal Tableau histogram bin sizes and visually displayed as stacked bars placed next to each other. Each of these bins represents the number of occurrences or frequency within each range of values. Histograms are typically plotted in a 2-dimensional plane where the horizontal axis (x-axis) represents the width of the bars.
In contrast, the vertical axis (y-axis) represents the height of the bars. The spaces between the bars represent the frequency in a particular category. Histograms are helpful to analyze the data distribution and identify the areas of maximum concentration.
A typical Histogram plot is shown below. The chart shows the distribution of quantity orders across many items in a particular order.
In the next section, we will go through the step-by-step process of how to create a Histogram in Tableau.
Table of contents
Key Takeaways
- Tableau Histogram displays the distribution of underlying data in the form of a series of connected data bars.
- It is plotted in a 2-dimensional plane where the x-axis represents the width of the bars, whereas the y-axis represents the height of the bars. The spaces between the bars represent the frequency in a particular category.
- Tableau provides an in-built histogram chart type option to create a histogram chart.
- You can apply a data filter to your Tableau histogram and add analytics customization as well.
- Tableau histograms can be exported into different formats such as images, data, spreadsheets, or PDFs and can also be hosted on an online server for distribution.
- You can use some of the alternative plots to Tableau histograms depending on your visualization requirements.
How to create a Histogram in Tableau?
To create a Histogram in Tableau, you may follow the instructions outlined below:
Step 1: Import your dataset into Tableau using the File Navigator in the Data Source tab, i.e., File – Open. Once imported, you can view the dataset details, including the data points, in the Data Source tab.
Step 2: Navigate to a new worksheet in Tableau.
Step 3: Drag Measure (Selling Price Per Unit) to Columns shelf.
Step 4: In the toolbar, click on Show Me and choose Histogram plot chart type from the available list of options.
Tableau will automatically create a histogram in the view. Note that the histogram aggregates the measures to display the count of the bins in the y-axis.
Step 5: Replace the Rows shelf with Invoice ID by dragging the field from the Data pane to the Rows shelf.
Step 6: Drag the Region to the Color in the Marks card. The Tableau histogram will be color-coded according to the region values.
Step 7: Hold the Ctrl key and drag the CNT(Invoice ID) to the Label on the Marks card.
Step 8: Change the Count values with percentages by choosing the Quick Table Calculation – Percent of Total.
Step 9: Right-click on the CNT(Invoice ID) and choose Edit Table Calculation from the context menu.
Step 10: On the Table Calculation window, select Cell under the Compute Using section.
Your Table Histogram will be available for data analysis and visualization.
Note: While Tableau histogram bin sizes are equally distributed, you can customize what fits your dataset best. To adjust the bin size, right-click on the measure, select Create bins, and specify the size of the bins.
You can also create a histogram calculated field before plotting a histogram chart by right-clicking on the Data pane and selecting the Create Calculated Field option. Use the Tableau histogram calculated field for your histogram visual.
It is critical to understand that the histogram is not available for all measures. This plot works well with continuous datasets. Tableau automatically converts discrete data points into a continuous dataset for histogram plots. If your dataset is not continuous, consider transforming it into a continuous dataset.
Examples
In this section, we have created different examples to demonstrate the Tableau Histogram plot.
Example #1
In this example, we will create a Tableau Histogram plot using the Country Health Trends dataset. This dataset contains key demographic and socio-economic indicators that are crucial for a wide range of analyses that can be used to study global development trends, compare regional progress, and identify factors that contribute to disparities in health and wealth.
To create a Histogram plot, follow the detailed instructions below:
Step 1: Navigate to the Data Source tab. Click on File – Open. Use the File Navigator to import the Country Health Trends dataset into the Tableau interface.
Once the data is imported, you can view them in the Data Source tab.
Step 2: Now, drag the Life expectancy measure from the Data pane to the Columns shelf.
Step 3: Click on Show Me in the tools navigator and select the histogram chart type from the available chart type options.
It will create a Histogram in the view, as shown below.
Step 4: Drag the Region (dimension) from the Data pane to the Color in Marks card. As you can see, the Histogram chart is now color-coded as per the different regions applicable.
Step 5: Hold down the Ctrl key and drag the CNT(Life Expectancy) field from the Rows shelf to Label in the Marks card. The bars will display the count values as shown below.
Step 6: Right-click on the CNT(Life Expectancy) field in the Marks card and choose Quick Table Calculation – Percent of Total.
Now, the count values will be replaced by the percentage values, as shown below.
Step 7: Right-click on the CNT(Life Expectancy) field in the Marks card and choose Edit Table Calculation.
Step 8: In the Table Calculation dialog box, change the value of the Compute Using field to Cell.
The Histogram is now ready for visualization.
Example #2
In this example, we will demonstrate creating another Tableau Histogram chart using the Mobile OS Market Share dataset which contains insights into consumer preferences, technological advancements, and the competitive landscape within the mobile industry.
To create a Tableau Histogram chart, the following step-by-step instructions can be applied:
Step 1: Import the Mobile OS Market Share dataset into Tableau using the File Navigator. Once the file is successfully imported, you shall be able to view it in the Data Source tab.
Step 2: Navigate to a new worksheet. From the Data pane, drag the Share (measure) to the Columns shelf.
Step 3: Click on the Show Me icon from the toolbar. Choose the Histogram chart type icon.
Tableau will create a histogram with the distribution of Share values, as shown below.
Step 4: Drag the Operating System from the Data pane to the Color in Marks card. The Histogram will be color-coded as per the different Operating System values.
Step 5: Hold the Ctrl key and drag the CNT(Operating System) field from the Rows shelf to the Label in Marks card.
Step 6: Right-click on the CNT(Operating System) field and select Quick Table Calculation – Percent of Total. The histogram chart will change the values to percentages.
Step 7: Right-click on the CNT(Operating System) field and select the Edit Table Calculation from the context menu.
Step 8: In the Table Calculation dialog box, change the value of the Compute Using field to Cell.
We have now successfully created a Tableau Histogram chart that can be further used for data analysis and visualization.
Example #3
In this example, we will create a Tableau Histogram chart using the Grocery Sales Prediction dataset which contains information about various grocery products, the outlets where they are sold, and their historical sales data.
To create a Histogram chart, the following steps can be very useful:
Step 1: Connect to the Grocery Sales Prediction dataset and import it into Tableau. The Data Source tab in Tableau will display the imported dataset details.
Step 2: Drag the Profit (Measure) to the Columns shelf.
Step 3: In the toolbar, click on Show Me to choose the Histogram chart type icon from the list.
Tableau will automatically create a histogram chart in the view, as shown below.
Step 4: Remove the CNT(Profit) field from the Rows shelf and drag the Outlet Type field to the Rows shelf. Click on the down arrow next to the Outlet Type field and select Measure – Count.
Step 5: Drag the Outlet Location Type field from the Data pane to the Color in the Marks card.
Step 6: Hold the Ctrl key and drag the CNT(Outlet Type) to the Label in the Marks card.
Step 7: Right-click on the CNT(Outlet Type) and select Quick Table Calculation – Percent of Total.
Step 8: Click on the down arrow next to the CNT(Outlet Type) and choose Edit Table Calculation from the context menu.
Step 9: In the Table Calculation dialog box, change the value of the Compute Using field to Cell.
Tableau histogram will be updated to display the percentage values as shown below.
Important Things to Note
- Tableau histogram bin size and bin numbers significantly impact the histogram chart. Ensure that you have accurately defined the Tableau histogram bin size for your chart visualization
- Histograms are suitable for the dataset comprising continuous measures. For discrete datasets, they are not useful and hence consider alternative charts for such data types
- Consider adjusting the axis scales for accurate data representation. Ensure any skewed data are properly addressed for data distribution accuracy.
- Ensure that the histogram charts are correctly interpreted for further data analysis and presentation.
Frequently Asked Questions (FAQs)
Tableau does not support adding additional layers to a Tableau histogram. However, you can certainly customize your chart by including analytical features such as Reference Line, Constant Line, Average Line, or Reference Band. However, you can certainly add annotations to a histogram to call out a specific mark, a specific point, such as a location on a map, or an area, such as a cluster of scatter marks. You can also edit an existing annotation, rearrange it, and remove or format these annotations to your visual.
Yes, you can apply filter data in Tableau histograms. To apply filter data, just drag and drop the field from the Data pane to the Filters shelf and specify the filter conditions to limit the dataset in your Tableau histograms. The filtered dataset will be further used for Tableau histogram plots.
To export a Tableau histogram in reports and presentations, you can use the export feature available in Tableau. Navigate to the Worksheet – Export and choose the format in which you want to export the chart. Typically, you can export the Tableau histogram chart in images, Data, spreadsheets, and PDF format. You may also directly host it in the Tableau server for others to access it, provided they have the required access to the Tableau server.
As alternatives to histograms in Tableau, you may consider chart types:
• Box and Whisker plots
• Scatter plots
• Density plots
• Stacked bar charts
• Line charts
• Heat maps, etc.
Recommended Articles
This has been a guide to Tableau Histogram. Here we explain how to create histogram plot in tableau with examples & points to remember. You can learn more from the following articles –
Leave a Reply