
1. Re: Mean and Standard Deviation in a Histogram
Ken Flerlage Aug 27, 2018 10:12 AM (in response to Carson Cunningham)You could use regular reference lines to create these, but Tableau doesn't allow you to create reference lines on a typical histogram (one that uses Bins), so I'd suggest that you create a calculated field which calculates your bins. You can then use that to create a regular bar chart, which will allow for reference lines. To do that, follow these steps:
1) Create a parameter called Bin Size so that the bin size is configurable.
2) Create a calculated field called LC Bin with the following formula: INT([LC to Opportunity Create Date]/[Bin Size])*[Bin Size]
3) Drag LC Bin to the columns shelf in place of the existing bin dimension.
4) Drag Bin Size to the Size card, then set the size to "Fixed".
At this point, you should have a histogram that looks exactly like your original.
5) Create a calculated field called Mean that calculates your mean (i.e. average): {FIXED : AVG([LC to Opportunity Create Date])}
6) Add all your filters to context so they are calculated before the LOD above is calculated.
7) Drag Mean to detail, then create a reference line on it, like this:
It should now look like this:
8) Follow similar steps to create a band or distribution reference line for your standard deviation.
FYI. I learned most of this from the following so please take a look at them as well
Discussion: Reference line over a distribution graph

Question for Tableau Forum.twbx 20.1 MB


2. Re: Mean and Standard Deviation in a Histogram
Carson Cunningham Aug 27, 2018 12:37 PM (in response to Ken Flerlage) 
3. Re: Mean and Standard Deviation in a Histogram
Carson Cunningham Aug 27, 2018 12:42 PM (in response to Ken Flerlage) 
4. Re: Mean and Standard Deviation in a Histogram
Ken Flerlage Aug 27, 2018 1:09 PM (in response to Carson Cunningham)Fantastic! Glad the approach is working for you. Would you be so kind as to mark my response as the "correct answer" so that we can close this thread and so others can quickly find the answer in the future? Thanks!

5. Re: Mean and Standard Deviation in a Histogram
Donald Li Oct 9, 2018 2:34 PM (in response to Carson Cunningham)I would like to add something to step 4:
After you move LC Bin to the column shelf, right click and convert it to dimension.
It was the missing step that really tricked me...

6. Re: Mean and Standard Deviation in a Histogram
Valentin Cran Mar 14, 2019 4:12 AM (in response to Donald Li)Hello guys,
thank you so much for this post, it helped me a lot.
Do you have an idea if this is also applicable for a boxplot? So for showing the quartiles and the whiskers?
I'm asking because I can't find functions for these parameters...
Thanks so much!