Uploaded February 2021 | Updated September 2026, 3 hours ago
The dataset -- us.csv -- if from NYT's GitHub repository:
github.com/nytimes/covid-19-data.
The NYT coronavirus page:
nytimes.com/interactive/2020/us/coronavirus-us-cases.html
This video shows how to generate the bar chart (one bar for each day) and then overlap the thicker line on top of the bars. The line shows the "7-day moving average" so it's smoother and gives a better trend view of the pandemic. The bars are good to see each individual day but because these can vary by a lot, they are better than a line which would look very jagged.
Note: the NYT file includes "cumulative" data, so each day shows the total since the pandemic started; it adds the current day number to the previous total. This means that the default bar/line will be always going up. Instead, we want to display the "daily" count (how many new cases in that particular day). In Tableau I show how to do this with a "calculation" without changing the original file. We duplicate the bars, change them to line; and this time apply two calculations, the subtraction and the 7-day average (although for some reason in the reverse order). These steps are the same for number 2, 3, and 4 videos.
The dataset -- us.csv -- if from NYT's GitHub repository:
github.com/nytimes/covid-19-data.
The NYT coronavirus page:
nytimes.com/interactive/2020/us/coronavirus-us-cases.html
This video shows how to generate the bar chart (one bar for each day) and then overlap the thicker line on top of the bars. The line shows the "7-day moving average" so it's smoother and gives a better trend view of the pandemic. The bars are good to see each individual day but because these can vary by a lot, they are better than a line which would look very jagged.
Note: the NYT file includes "cumulative" data, so each day shows the total since the pandemic started; it adds the current day number to the previous total. This means that the default bar/line will be always going up. Instead, we want to display the "daily" count (how many new cases in that particular day). In Tableau I show how to do this with a "calculation" without changing the original file. We duplicate the bars, change them to line; and this time apply two calculations, the subtraction and the 7-day average (although for some reason in the reverse order). These steps are the same for number 2, 3, and 4 videos.










