Histograms provide a graphical representation of the distribution of numerical values. They look similar to bar charts but are different. Bar charts compare different categories of data while histograms display the distribution of a variable.
To make a histogram, bins of EQUAL size are constructed - each bin is plotted as a bar & the height corresponds to how many data points fall within each bin (Bins can also be referred to as "intervals", "classes" or "buckets")
Let's explore an example:
I want to create a dynamic histogram in Tableau showing the distribution of casualty Age across road traffic accidents in London by casualty class
Steps I took:
- I Inspected the data - remember it's important to check your data has the right shape & relevant fields for your calculation
- I Right-Clicked Casual Age, went to Create and selected Bin
![](https://www.thedataschool.co.uk/content/images/2022/05/1.-Right-Click.png)
- I clicked the drop-down menu and created a parameter - In the current value, I selected how big I initially wanted the bins, clicked all values, clicked ok and showed the parameter
(It's important I create a parameter at this stage to allow the histogram chart to be dynamic, allowing the user to control how big the bins will be)
![](https://www.thedataschool.co.uk/content/images/2022/05/2.-Create-a-new-parameter-from-Edit-Bin.png)
![](https://www.thedataschool.co.uk/content/images/2022/05/3.-Parameter.png)
![](https://www.thedataschool.co.uk/content/images/2022/05/Show-Parameter.png)
- Now a new field should be created in the data pane
![](https://www.thedataschool.co.uk/content/images/2022/05/5.-New-Bin-Field.png)
- I dragged the bins to the columns & add the count of road traffic accidents to rows
- I also added casualty class onto the rows before the count of road traffic accidents, so the view can be broken up by Driver/Rider, Passenger and Pedestrian
![](https://www.thedataschool.co.uk/content/images/2022/05/6.-End-Result-.png)
- As the scales are quite different I edited the axis to be independent of each other - Right Click Count Axis - Edit Axis
![](https://www.thedataschool.co.uk/content/images/2022/05/Edit-Axis.png)
- Now that my chart is finished, I can go into parameters and change the size of my bins to a higher or lower value
![](https://www.thedataschool.co.uk/content/images/2022/05/7.-Ban-Higher-Value.png)