# How to Build a Control Chart in Tableau Using Parameters & Window Calculations

How do you build a control chart in tableau in this example I’m showing sales by month and I’m coloring each dot by whether it’s in control or out of control let’s take a look at how to build this in tableau. I have the calculations already built and I will describe them to you I start with average now open this average calculation zoom in we want an average line I’m just going to get the window average of sum of sales give us an average line in the middle click ok drag that on to detail or right click the axis add a reference line and calculate the average of average. Let’s remove the computation and click ok so that’s my average line you need to create a upper control limit and a lower control limit I have those built as well to edit the lower control limit field. What we’re going to do is take the average minus the number of standard deviations that are chosen multiplied by the window standard deviation of sum of sales I’m going to bring lower control limit into the view add that reference line as well. And click ok so I have my lower control limit as well any dot that’s below the limit is out of control upper control limit is just the opposite average plus the standard deviations times the Windows standard deviation of sum of sales okay put upper control limit onto detail and let’s add a reference line. Upper control limit and the average we could remove the label now to cover these dots I need to test whether these are out of the lines or in the lines a field called color let’s edit that so it’s simply testing if sum of sales is less than the control limit and sum of sales is greater than the lower control limit then it’s in control so if it’s in this range it’s in control otherwise it’s out of pixel click on the second sum of sales which is your dots and put color on the color Shelf that’s going to color each of your dots let’s put the parameter on into the view show parameter and see what happens when we change this to 0.5 you change it to 0.5 more dots are out of control let me just change it to 1.5 and more dots are in control hope this helps.