Tableau Deep Dive: Parameters – Bins


Tableau Deep Dive: Parameters – Bins

Tableau Deep Dives are a loose collection of mini-series designed to give you an in-depth look into various features of Tableau Software.

In the next article of our Deep Dive on parameters, we’ll explore how we can use parameters to allow our report users to choose the size of their bins within a histogram.

Histogram Review

We talked about the histogram in our Tableau Essentials series here. It’s a visual representation of data, grouped by bins. Let’s build an example using the Sample – Superstore.xlsx data source.

I want to know how long it takes for my products to ship. An average gives me a high level of detail, but it isn’t really that useful. I want to the breakdown of how many products take 1 day, 2 days and so forth to ship. Using the DateDiff function, I’ve created a calculated field called Days to Ship.

DATEDIFF(‘day’, [Order Date], [Ship Date])

Here’s the histogram I’m going to create:

Tableau Days to Ship Histogram

There are two important things here when it comes to building a histogram. First, for your measure, you want to take the Count of it rather than Sum. That’s because we want to know how many instances fall into our bins. Second, the bins themselves: To create a bin, we right-click on the measure and select Create > Bin. That bin will serve as our dimension for our view. Here’s the Create Bin window:

Create Bins [Days to Ship]

I’ve set the size of my bin for 1, as in 1 day; but if I use the drop-down menu, then I see the option for me to insert a parameter:

Create a new parameter...

Parameterized Bins

Creating a parameter for a bin is the same as it is for any other type of parameter. Remember our four steps:

  1. Create Parameter
  2. Use Parameter in a Calculation
  3. Show Parameter Control
  4. Use Calculation in our View

We’re going to create the parameter now for step #1. As the parameter is being used for a bin inside of our histogram that covers #2 and #4. The last thing we’ll have to do is show the parameter control so our report viewer can use it.

For a bin parameter, I recommend sticking with the Range for Allowable values. Our particular use case for days to ship only has values up to 7, so I’ll make our parameter settings as such:

Tableau parameter settings

Our minimum value is 1 day per bin. Our maximum value is grouping products that took multiples of 3 to ship. For instance, all products that took 0, 1 or 2 days to ship would go into our first bin at the maximum size. All products that took 3, 4 or 5 days to ship would go into the next one and so forth. Tableau will automatically select Float as your data type on initial creation. To change it to Integer, which makes sense for our histogram, go back and edit your parameter. You can then select Integer from the Data Type drop-down option.

Time to show our parameter control. Remember, right-click on the desired parameter in the Parameters section of the Data pane and select Show Parameter Control:

Show Parameter Control

As you can see, I’ve selected a slider for the parameter control as it makes the most sense for what we are showing. You can edit your parameter control just like a filter with a lot of the same options in terms of how they display and function for the report user.

What’s Next?

In our next topic on the Parameter Deep Dive, we’ll look at reference lines. As always, I’d love to hear from you. Be sure to add your thoughts, suggestions, questions or additional ideas in the comments section below. Happy histogramming!

Want More Tableau Deep Dives

  1. Tableau Deep Dive: LOD – Introduction to Detail
  2. Tableau Deep Dive: LOD – The Include Calculation
  3. Tableau Deep Dive: LOD – The Exclude Calculation
  4. Tableau Deep Dive: LOD – The Fixed Calculation
  5. Tableau Deep Dive: LOD – LOD Calculations vs. Table Calculations
  6. Tableau Deep Dive: Parameters – Parameter Overview
  7. Tableau Deep Dive: Parameters – Parameter Properties
  8. Tableau Deep Dive: Parameters – Filtering – Top N
  9. Tableau Deep Dive: Parameters – Calculated Fields
  10. Tableau Deep Dive: Parameters – Filtering Across Data Sources
  11. Tableau Deep Dive: Parameters – Bins
  12. Tableau Deep Dive: Parameters – Reference Lines
  13. Tableau Deep Dive: Parameters – Table Calculations
  14. Tableau Deep Dive: Sets – Introduction to Sets
  15. Tableau Deep Dive: Sets – Constant Sets
  16. Tableau Deep Dive: Sets – Computed Sets
  17. Tableau Deep Dive: Sets – IN/OUT
  18. Tableau Deep Dive: Sets – Combined Sets
  19. Tableau Deep Dive: Sets – Calculated Fields
  20. Tableau Deep Dive: Sets – Hierarchies
  21. Tableau Deep Dive: Dates – Introduction to Dates
  22. Tableau Deep Dive: Dates – Preparing Dates
  23. Tableau Deep Dive: Dates – More Date Functions
  24. Tableau Deep Dive: Dates – Exact Dates
  25. Tableau Deep Dive: Dates – Custom Dates
  26. Tableau Deep Dive: Dates – Rolling Dates
  27. Tableau Deep Dive: Dates – Calendar Filters
  28. Tableau Deep Dive: Dates – Week-by-Week Comparison
  29. Tableau Deep Dive: Dashboard Design – Planning
  30. Tableau Deep Dive: Dashboard Design – Layout & Structure
  31. Tableau Deep Dive: Dashboard Design – Proof of Concept
  32. Tableau Deep Dive: Dashboard Design – Adding Interactivity
  33. Tableau Deep Dive: Dashboard Design – Visual Best Practices
  34. Tableau Deep Dive: Dashboard Design – Optimization & Governance
  35. Tableau Deep Dive: Dashboard Design – Publishing
  36. Tableau Deep Dive: Table Calculations – Custom Sorts, Part One
  37. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Two
  38. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Three

More About the Author

Robert Curtis

Managing Director, APAC
Surveys Reveal the 5 Biggest Pain Points for Data & Analytics Leaders InterWorks has been a global, full-stack consulting firm for many years now. A big part of our job as consultants is to first listen to ...
Kickstarting Data Innovation in Healthcare On 13 March 2024, InterWorks was a proud Platinum sponsor of the first ever Data & Analytics in Healthcare conference, hosted by ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK


Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Geschäftsführer: Mel Stephenson

Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072


Love our blog? You should see our emails. Sign up for our newsletter!