Histograms are great for helping us understand distributions of data, but Tableau currently doesn’t allow for the ability to label the upper and lower bounds of bins ranges.
Feel free to download the workbook from Tableau Public
Step 1: Create a Calculation
Here I’ve built in a parameter so I can adjust the size of the bins dynamically. If you only need it be a certain size, simply replace the purple fields with your bin size.
str(INT([Fare]/[Bin Size])*[Bin Size]) + ‘ – ‘ + str(INT([Fare]/[Bin Size])*[Bin Size]+[Bin Size])
The calculation works in 2 parts:
1) Calculating the upper and lower bound of the range.
2) Converting these values to strings and adding formatting with the “-”
Step 2: Build your view!
Thanks for reading!