Introduction
Although Tableau gives us many ways of counting and labeling data points on the charts we create, every once in a while we have to be creative to get the counting and labeling the way we want it to be.  This post shows one example that required me to be a little creative to get the counting and labeling the way I wanted it to be on a time series chart of daily production data.
If you like this article and would like to see more of what I write, please subscribe to my blog by taking 5 seconds to enter your email address below. It is free and it motivates me to continue writing, so thanks!
The Example
Figure 1 shows example time series data that can represent many things that can be quantified with a binary counter. Â In this example, let’s assume this data represents the daily production levels of widgets for various client accounts. Â On any given day, widgets go into production for certain accounts but they are not always created within a work day, so the daily count is either a 0 (not finished) or 1 (finished). Â Sometimes it takes a while for the widget order to be completed because of the specifications given for the widgets (some are harder to produce than others). For production data like this, to generate a daily total production count is not as simple as creating a histogram because the histogram only gives you a count of 1 or 0 and there are multiple records per day. Â Figure 2 shows what the daily widget production data looks like in a time series plot in Tableau.
In this example,  several months of daily widget production data are examined.  The challenge of this example is to be able to examine the time series history of each production level (0, 1, 2 …5) separately. To accomplish this, a special technique for counting and labeling each daily production level was developed.
The Counting and Labeling Technique For The Entire Production History
Examining the entire production history is easy simply by using an index function to label the daily production levels (Figure 3) and a running total (Figure 4) to show how many widgets were produced over time.
As shown in Figure 3, the daily production rate varies from 0 to 5 widgets per day. Â As shown on Figure 4, the overall production rate is generally linear with a average of 1.3 widgets produced per day. Â In total, there were 303 widgets produced in 237 production days.
The Counting and Labeling Technique For Each Daily Production Level
To examine production performance, it might be useful to look at the production data at discrete levels. Â For example, Figure 5 shows the production data for all eight days where 4 widgets were produced.
Figure 6 shows the running total of eight, 4-widget production days (32 total widgets produced).  This chart shows that a long time was needed to achieve the second,  4-widget production day. There also was a period of high production from the fifth to seventh day of 4-widget production days.  It seems that either something was improved in the production process during this time or that the crews were able to somehow successfully create four widgets per day on those occasions by really concentrating on multiple jobs.
Figure 6 – Running Total of 4-Widget Production Days.
Video 1 shows how the calculated fields are set-up in Tableau to examine the production data for any of the discrete production levels (0 to 5 widgets per day). Â A parameter is used to choose the production level of interest (0-5) and the time series and running total charts are counted and labeled as shown in Figures 5 and 6. Â One nice feature about this technique is that the counting and labeling technique will work for any time period selected (using the time sliders) in the analysis.