Error bars help to indicate estimated error or uncertainty to give a general sense of how precise a measurement is.
Let’s now see how to build step-by-step error bars on Tableau. Our goal is to create a chart showing sales margins per month from Sample Superstore data.
Step 1. Create error bars
- Connect to the data source Sample – Superstore.
- Drag Sales to Rows. Right click on it and select Measure (Sum) > Average.
- Drag Order Date to Columns. Right click on it and select Month May.
- Select Circle from the dropdown menu in the Marks card. Fit to Entire view.
Â
Â
- Create a Calculated field. Let’s call it Sales margin and type 96*(STDEV([Sales])/SQRT(COUNT([Sales]))).
- Create another Calculated field. Let’s call it Upper and type avg([Sales])+[Sales margin].
- Create another Calculated field. Let’s call it Lower and type avg([Sales])-[Sales margin].
- Drag Sales margin, Upper and Lower on Detail in the Marks card.
- Click on the Analytics pane, drag Reference band on Cell as in the picture below. Right
Â
Â
- Fill out the window as below.
Â
Â
- Right click on one of the numbers on the view and select Format > Numbers > Number (custom) > 0 decimal places. Also align horizontal to the center from that same pane.
- Adjust the size of the circles from the Marks card.
- Drag Sales on Label. Right click on it and select Measure (Sum) > Average.
- Right click on it and select Format > Numbers > Number (custom) > 0 decimal places.
- Click on Label in the Marks card and select vertical alignment to the centre. Done!
Â
Â
Don’t wait! Contact us to learn more and continue to follow upcoming news on our website and LinkedIn channel.