Although the Map & Data Library is physically closed, we are still available remotely and happy to help. We can conduct consultations using online teleconferencing software. Please feel free to contact us at or use our help form. We have a number of tutorials available, are still supplying software licenses, and have compiled a list of resources for working with COVID-19 data.

COVID-19: Updates on library services and operations

Creating a Tableau Dashboard using COVID-19 data (Intermediate)

Table of Contents

The Dashboard
Starting a Visualization Project
Tableau Tutorial


This tutorial is to give you an opportunity to learn some data visualization skills using a common data visualization tool, Tableau Desktop. People often say that they learn better when using data that resonates with them, so we are using COVID-19 data in this tutorial, as this topic is touching many people’s lives right now. 

DISCLAIMER: This is a very complex topic and situation right now. If you are new to data visualization, this tutorial will help you build your skills, but that does not mean you should then be sharing all the COVID-19 visualizations you create. Leave that to experts, many of whom have already done this. COVID-19 data is not a “cool new dataset” to play with and data visualizations in this context MUST NOT be misleading, inaccurate, or incite panic. Each data point represents a person. Responsible and sensitive visualizations are essential. Epidemiology is also a complex area; fully understanding the data, statistics and visualizations is critical to producing and sharing useful and effective visualizations on this topic. So we recommend that for beginners you create visualizations, such as the one created in this tutorial, for just yourself, for your own learning. 

Before embarking on this tutorial, do the following: 

  1. Get more familiar with the topic and data, and the concerns and precautions around visualizing it: 

    1. 10 considerations before you create another chart about COVID-19 (Tableau) 

    2. A complete guide to coronavirus charts: Be informed, not terrified (Amanda Makulec, Excella, FastCompany) 

    3. 17 (or so) responsible live visualizations about the coronavirus, for you to use (Datawrapper) 

    4. What the BBC got wrong in their COVID-19 visualization (Tableau) 

  2. Install Tableau Desktop (This tutorial was created using Tableau Desktop version 2020.1.2) 

  1. Get more familiar with the tool we’re going to be using by trying some of our other Tableau tutorials first: 

    1. Creating Data Vizualizations Using Tableau Desktop (Beginner) 

    2. Getting Started with Tableau Desktop (Beginner to Intermediate) 

The Dashboard 

This tutorial will be focused on learning how to recreate aspects of this old dashboard (seen as a screenshot) and this new dashboard using Tableau Desktop. Note: This dashboard used to have information on recoveries as well, which is best practice for COVID-19 visualizations, but unfortunately the dataset it was based on removed recovery information, as they concluded the data was too unreliable. 

When working to emulate a Tableau dashboard found on the Tableau Public website, you can often click on the download icon (hover over the icons at the bottom right of the dashboard to find it) and download the underlying workbook (if the owner gave permission).
Tableau Public workbook with download button highlighted
Download menu with Tableau Workbook option highlighted
This is a great way to learn how to create dashboards in Tableau. However, in some situations, a workbook can be so complicated that it might take a while to unpick and understand what is going on. That is the situation here, and why this tutorial was created. 

Starting a Visualization Project

Before embarking on any visualization project, you should always consider your audience and purpose for your visualization (Stage 1) (see our Data Visualization Guide Design Workflow section for more details). For the purposes of this tutorial, the audience is for your eyes only and the purpose is to learn how to visualize data in Tableau Desktop. 

Next, you need to select you data and gain an understanding of it (Stage 2). For this tutorial, we started by using a Google Sheet document that was being continuously cleaned and updated by Tableau daily (see this page for details). This was not necessarily the most authoritative or up-to-date data source to use for this topic; see our resources pages for other sources out there. It was selected as a good source to demonstrate linking to real time data in Tableau. 

Note: The dashboard and dataset are constantly changing. Unfortunately, these instructions no longer work with the current google sheet, so instead download this snapshot of the data (from April 7, 2020) to use with the tutorial instead. In Tableau’s Connect screen, connect to an Excel file instead and browse to this snapshot file, then skip to step 2 to continue the tutorial. We leave the old instructions up for your reference on how you would connect to a google sheet datasource. More details about this dataset and how it has changed since this tutorial was created can be found on this Tableau page

Tableau Tutorial 

Connecting to a live dataset that has multiple sheets 

  1. First start up Tableau Desktop and connect it to a Google Sheet of the COVID-19 data. In Tableau’s Connect screen, under To a server, select Google Sheets. 
    Tableau's connect menu
    Follow the prompts to allow Tableau to access your Google account. Go back to Tableau. From a list of sheets, you should see COVID-19 Cases, highlight it, and then click on Connect. If you don’t see that sheet, then, in the URL bar, paste this link: and click on Search. Then highlight the sheet COVID-19 cases, and click on Connect.
    Window for selecting Google sheet to connect to
    Since this is a popular dataset, it might take some time to first connect to it, and then to load the data. 

  1. Drag New Union listed on the left to the orange box in the centre of the screen that says “Drag sheets here.”
    Tableau's database join page

  1. Next drag in the sheets called COVID-19 Confirmed and COVID-19 Deaths into the Union box, and click on OK. This will create a dataset combining all the rows in both of these sheets (they share the same columns). 
    Union popup

  1. Click on Sheet 1 (in orange at the bottom) to create a new worksheet. 

Create side-by-side bar graphs with filters for cases by day

  1. First, create the side by side bar graphs of confirmed cases and deaths over time. Right click on the Sheet 1 tab at the bottom, select Rename, and give it the name “CasesbyDay”. 
    Renaming the new sheet

  1. From under Dimensions, drag Date next to columns. Note that it defaults to YEAR(Date). To format how the date is displayed, right click on YEAR(Date) and select Day, specifically the option that has the example May 8, 2015.  
    drop down menu for YEAR(Date) with DAY highlighted

  1. Right click again on DAY(Date) and this time select Discrete - as the data updates daily, it is not a continuous flow. 
    Drop down menu with Discrete highlighted

  1. From under Measures, drag Cases next to rows. 
    Column and row pills

  1. On the Marks card, from its drop down that says Automatic, change it to Bar. 
    Bar highlighted in the Marks dropdown menu

  1. From under Dimensions, drag Case_Type next to columns, to the left of DAY(Date). This creates two side-by-side bar graphs showing cases by day. By sharing the y-axis, you can more accurately compare the data. To see them both without scrolling, drop down on Standard at the top and change the view to Entire View. 
    Two bar charts, with Entire View and Case_Type highlighted

  1. Let’s use colours to differentiate the two categories. Drag Case_Type to Color on the Marks card. Click on Color and then select Edit Colors. 
    Edit Colours button
    Leave Confirmed cases at the default blue, but select Deaths then the purple available in the default palette to change it. Then click on OK. 
    Edit colours menu, with Deaths changed to purple

  1. Let’s clean up the axes so that when the graphs are displayed in the dashboard, they don’t take up so much room. Right click on the x-axis listing the dates, and uncheck Show Header. Since one day will be highlighted, click in the white space of the graph to unselect that day. 
    X-axis menu

  1. Right click on the Case Type header in the graph, and select Hide Field Label for Columns.  
    Dropdown menu for Case_Type column

  1. We can also add some filters to these graphs, so that a user could filter to see a certain country or date range. Under Dimensions, drag Country_Region to the Filters shelf. Click on All and then OK.
    Country_Region highlighted, the Filters table highlighted, and the resulting window
    Then right click on the Country Region pill on the Filters shelf and select Show Filter. 
    Dropdown menu for Country_Region pill
    You will see a list of countries on the right. If you hover over the title of the list, you should see a small arrow on the right that you can use to access a drop-down menu.
    Dropdown button highlighted
    Click on it and select Single Value (dropdown).
    Dropdown menu for Country_Region, with Single Value (dropdown) selected
    This makes the filter take up a much smaller amount of space on the screen, and eventually the dashboard. Make the country filter include All countries for now. 

  1. Under Dimensions, drag Date to the Filters shelf. Select Relative Date and click Next.
    Filter Date Menu
    Go to the Starting Date tab, check Include Null Values, and then click OK. 
    Starting Date window
    Then right click on the Date pill on the Filters shelf and select Show Filter. You will see a slider Date filter on the right.
    Date, Country_Region, and Case_Type filters and legends 

Create a parameter so that the graphs change based on whether the user wants to see total cases or new cases 

  1. Right click in the blank space in either the Measures or Dimensions section, and select Create Parameter… 
    Creating a parameter
    Name it Select Metric. Change data type to Integer. Under Allowable values, click List. In the List of Values below, click on the first row under Value and type 0. Next to it, in the same row under Display As, type Total Cases. On the next row, under Value type 1 and under Display As type New Cases. Click elsewhere in the list to stop editing New Cases. Then click OK. You will see a new section appear under Measures, called Parameter, listing the new parameter we just created. This parameter will allow the user to specify if they want to review data for total cases or new cases.
    Create Parameter window with details filled in as described

  1. Currently, the parameter just collects input from the user, but doesn't act on it. To apply the choice to the graph, we need to create a field that acts on that choice and displays what data was requested. From the Analysis menu, select Create Calculated Field...,
    Analysis menu
    and name it Metric Switcher. Paste in the following formula: 
    IF [Select Metric]=0 THEN [Cases] ELSE [Difference] END
    Calculated Field window with formula copied in
    Then click on OK. You should see this new field under the Measures section. 
    Note: Whenever a variable is mentioned (e.g. [Cases]), you can either type the variable name exactly as it is shown or drag the variable’s pill into the calculation field. 

  1. In the rows section, right click on SUM(Cases), and select Remove.
    Dropdown menu for SUM(Cases)
    Then, from under Measures, drag Metric Switcher next to Rows.
    New pills under Columns and Rows

  1. From under Parameters, right click on Select Metric, and select Show Parameter Control.
    Menu that appears after clicking on Select Metric
    Now you can adjust whether Total Cases or New Cases are displayed in the bar graphs using this menu. It will sum either the field Cases or Difference depending on what was selected. 

Create a dynamic mark label 

  1. Let’s add a dynamic mark label to highlight today’s data in the graph. From under Measures, drag Metric Switcher to Label on the Marks card. From under Dimensions, drag Date to Label too.
    Label mark on the marks card

  1. Right click on the YEAR(Date) pill listed on the Marks card, and select Exact Date. 
    The menu from the YEAR(Date) pill, with Exact Date highlighted

  1. Click on Label on the Marks card. Under the Marks to Label section, select Most Recent. Under the Label Appearance section, click on the gray button with ellipses next to Text.
    Label card
    Center both lines (if not already) and bold them. Change <SUM(Metric Switcher)> to size 12, and <Date> to size 10. Then click on OK. 
    Label Text window, with bolded and resized text

  1. While still on the Label popup, under the Label Appearance section, click the Alignment dropdown menu. Set Horizontal alignment to right justified, Direction (of text) to a right-side up A, Vertical alignment to top, and Wrap to off. 
    Mark Label Alignment sub-menu
    Note: Sometimes you need to select a sideways A first and then the right-side up A in order to make the change stay – just a bug. Now you should see a dynamic label for our latest data point. 

Create a dynamic bar graph embedded in a tooltip

  1. Let’s create a small bar graph that will show up as part of a tooltip when you hover over a bar in the graph. First, create a second worksheet, naming it Tooltip.
    Location of the Create Worksheet button
     Naming the new worksheet Tooltip

  1. From under Measures, drag Metric Switcher next to columns. 

  1. From under Dimensions, drag Case_Type next to rows.  

  1. Also, from under Dimensions, drag Case_Type to Color on the Marks card. 

  1. Right click on the x-axis and uncheck Show header. 
    Tooltip sheet with X-axis menu

  1. Within the bar graph, right click on the Case_Type header listed above Confirmed and Deaths on the y-axis. Click Hide Field Labels for Rows. 
    Dropdown menu for header
    Note: Do not right click on the Case_Type pill next to Rows. This specifically refers to an option only present when clicking on the tab within the graph. 

  1. Click on Label on the Marks card and check Show Mark Labels. Then click away.
    Final tooltip, with labels and headers removed, and labels displayed

  1. Go back to the CasesbyDay worksheet and click on Tooltip on the Marks card.
    CasesbyDay sheet with Tooltip on marks card highlighted
    Delete all text except for <DAY(Date>. Then, underneath <DAY(Date)>, click on Insert, Sheets, Tooltip.
    Labels window with Insert dropdown menu

  1. In the ensuing block of text, highlight <All Fields> (but leave the surrounding quotation marks), click on Insert, and then click DAY(Date).
    Label sheet with Tooltip text inserted, still needing to edit line
    Label tooltip, with final text
    Then click OK. As you hover over the various bars, you will now see the Tooltip worksheet in miniature, filtered by the date, showing the day’s data. 
    CasesbyDay worksheet with tooltip appearing while hovering over specific bars

  1. To finish up, let’s clean up the axes a bit more. Now that we have added a label and a tooltip, right click on the y axis and uncheck Show Header to remove that extra information and make the graph more compact for our dashboard.
    Removing the y-axis
    Final graph, with y-axis label removed

Create side-by-side proportional symbol maps of cases with dynamic tooltips 

  1. For the next section of the dashboard, we need to create some maps. First, create a third worksheet and name it Map. For best practices on mapping COVID data, including an explanation of the choice of why one might use a logarithmic scale to size the proportional symbols (which we will do in this case), see this blog post from Esri on Mapping Coronavirus, responsibly

  1. From the Analysis menu, select Create Calculated Field..., and name it Log of Metric Switcher. Paste in the following formula: 
    LOG(SUM([Metric Switcher]))
    //Used for the map mark size scaling
    Then click on OK. 
    Note: The double forward slashes are used to denote comments. They are notes to help you and anyone else looking at your code to understand what it is doing, but it has no effect.
    Create calculated field window with the formula added

  1. Holding the CTRL key (or the Command key on a Mac), click on Lat, Log of Metric Switcher, and Long to select all of them from under Measures. Release the CTRL key and click on Show Me tab (top right). Click on the recommended graph type, which is a proportional symbol map. Then, click on the Show Me tab afterwards to close it.
    Three variables selected on the left; proportional symbol map highlighted under the Show Me menu

  1. In the columns section, right click on the Long pill and select Dimension. Do the same thing for the Lat pill. 
    Dropdown menu on AVG(Long), highlighting Dimension

  1. From under Dimensions, drag Case_Type next to columns, to the left of Long to create side-by-side maps.

  1. From under Dimensions, drag Case_Type to Color on the Marks card to apply the same colour scheme as the previous visualization.
    Two maps, with color-coding, and pills placed as described

  1. From the Analysis menu, select Create Calculated Field..., and name it Max Date. Paste in the following formula: 
    //A Level of Detail calculation, using curly brackets to calculate at the level of whole table, to find the most recent date
    Max Date calculated field with formula

  1. Create another calculated field: from the Analysis menu, select Create Calculated Field..., and name it Date is Max, Paste in the following formula: 
    [Max Date] = [Date]
    //Boolean logic used to display the most current date’s information
    Date is Max calculated field with formula

  1. From under Dimensions, drag Date is Max to the Filters shelf, select True, and click on OK. This will ensure that the map is only displaying data for the most recent date.
    Popup window for Date is Max, with True checked

  1. From under Measures, drag Metric Switcher to the Filters shelf. Select Sum and click Next.
    Filter menu, with sum selected
    Click on the At Least tab, set the minimum value to 1, and then click OK. This ensures the map will only show data where there is at least 1 case.
    Filter menu part two, on the At least tab, minimum is 1

  1. Click on Color on the Marks card, and in the window that pops up, make the following changes: under the Effects section, set Border and Halo to white, and set the Opacity to 50%. Click away from the popup to close it.
    Popup Color menu with 50% opacity and border and halo set to white

  1. From the Analysis menu, select Create Calculated Field…, and name it Location Detail. Paste in the following formula: 
    IF [Country_Region] = "US" THEN [Admin2]
    ELSEIF [Province_State] != "N/A" THEN [Province_State]
    ELSE [Country_Region]
    //Used to determine the smallest level of detail for which there is information
    //Note that Admin2 stores information on US counties
    Location Detail calculated field

  2. From under Dimension, drag Location Detail to Detail on the Marks card, so that data displayed on the map is shown at the smallest level of geography available (i.e., country, province/state or county).
    Overview of Map worksheet with Location Detail added to the Detail marks card

  3. Next, we will need to create a few calculated fields to use in our tooltip. From the Analysis menu, select Create Calculated Field…, and name it Province State Label. Paste in the following formula: 
    IF [Province_State] != "N/A" THEN [Province_State]
    ELSE ""
    //Used in map tooltip to display a province/state name, if present
    Province State Label calculated field

  1. From the Analysis menu, select Create Calculated Field…, and name it Admin2 Label (US). Paste the following formula: 
    IF [Country_Region] = "US"
    THEN " | County: " + [Admin2]
    ELSE ""
    //Used in the map tooltip to display a county name as well, if in the US
    Admin2 Label (US) calculated field

  1. From under Dimensions, drag Max Date, Country_Region, Admin 2 Label (US), and Province State Label on to Tooltip on the Marks card.
    Marks card displaying those four variables added to the Tooltip card

  1. Go to the Tooltip worksheet we created for the first visualization. Right click on the Tooltip worksheet’s tab at the bottom and select Duplicate. Rename the duplicate (called Tooltip (2)) MapTooltip.
    Duplicate option when right-clicking on Tooltip worksheet

  1. In the MapTooltip worksheet, right click on Tooltip(DAY(Date)) in the Filters shelf and select Remove. 

  1. From under Dimensions, drag Date is Max on to the Filters shelf, select True, and click on OK. 

  1. Return to the Map worksheet and click on Tooltip on the Marks card. Delete all the text and insert the following attributes in order (on separate lines where noted): 
    <ATTR(Max Date)>
    <ATTR(Province State Label)><ATTR(Admin2 Label (US))>
    Then, insert the MapTooltip sheet by clicking on Insert, then Sheets, then MapTooltip.
    Within the new line for the MapTooltip sheet, highlight <All fields> (leaving the quotation marks unselected) and then insert Location Detail. 
    The final text should look like this: 
    <ATTR(Max Date)>
    <ATTR(Province State Label)><ATTR(Admin2 Label (US))>
    <Sheet name="MapTooltip" maxwidth="300" maxheight="300" filter="<Location Detail>">
    Tooltip with text inserted
    Once you are done, click on OK. Hover over symbols on the map to see this tooltip in action.
    Hovering over Anoka County, Minnesota, in the map worksheet, showing the tooltip

  2. Finally, let’s clean up the map. In the lower right corner, there is a gray warning listing the number of null values. Click on this box.
    Map with nulls warning highlighted
    When it asks you what to do, click on Filter values. 
    Null value warning popup, with Filter data highlighted

  3. Also, let’s remove a few headers as we did with the first visualization. Right click on the Case_Type header at the top of the map, and select Hide Field Labels for Columns. Right click the Confirmed header on the top left of the map, and uncheck Show Header.
    Map with these final changes made

Create side-by-side bar graphs for cases by country 

  1. For the third section of the dashboard, create a new worksheet, and name it “CasesbyCountry.”

  1. From under Measures, drag Metric Switcher next to columns. 

  1. From under Dimensions, drag Country_Region next to rows. 

  1. From under Dimensions, drag Case_Type next to columns, to the left of Metric Switcher. 

  1. Also, from under Dimensions, drag Case_Type to Color on the Marks card. 

  1. Right click on the Country Region pill next to rows and select Sort.
    CasesbyCountry worksheet with Country_Region dropdown
    Change Sort by to Field, under Field Name pick Metric Switcher, sort Descending, and then close the sort window. 
    Sort popup window with settings as described

  1. From the Analysis menu, select Totals, and then select Show Columns Grand Totals.
    Analysis menu dropdown with Show Column Gran Total highlighted

  1. Go back to the Analysis menu again, select Totals, and then select Column Totals to Top.
    Analysis dropdown menu showing Totals, Column Totals to Top
    You will see the grand total appear as the first bar in the graph.
    Both horizontal bar graphs side-by-side with grand totals at top

  1. From under Dimensions, drag Date is Max to the Filters shelf, select True, and click on OK. This will ensure that the graph is only displaying data for the most recent date. 

  1. Click on Tooltip on the Marks card. Deselect Show tooltips to remove tooltips for this graph.
    Tooltip popup with Show tooltips unchecked

  1. Let’s clean up this bar graph so it will be ready to use in our dashboard. Right click on the x axis and uncheck Show Header. Right click on the Case Type header, and select Hide Field Labels for Columns. Right click on the Confirmed header and uncheck Show Header. Right click on Country_Region header and click Hide Field Labels for Rows. After clean up, your graph should look like this:
    Paired bar graphs with all headers and axis labels removed

  1. Click on Label on the Marks card and select Show Mark Labels. Also check off Allow labels to overlap other marks.
    Label Marks card

Create a dashboard to pull these three visualizations together 

  1. Finally, let’s create a dashboard to pull all of these visualizations together. Click on the new dashboard icon at the bottom to create a new dashboard.
    New Dashboard button

  1. Under Size on the left, use the dropdown menu to change Fixed Size to Automatic.
    Size dropdown menu

  1. Drag CasesbyDay, from the sheet list on the left, on to the dashboard.
    Dragging the CasesbyDay sheet onto the dashboard
    Then, drag Map, from the sheet list, to take up the bottom half of the dashboard. 
    Dashboard with map dragged to bottom half
    Finally, drag CasesbyCountry, from the sheet list, to take up the bottom quarter of the dashboard. 
    Dashboard with CasesbyCountry dragged to the bottom quarter

  1. From under Objects (bottom left), drag Text to the top of the dashboard. This will be your title.
    Dragging Text to the top of the dashboard
    Call your dashboard COVID-19 Cases. Change the text size to 20 points, bold it, and click on OK.
    Text edit window
    Resize the bottom of this new text box to minimize white space.
    Dashboard after resizing the title bar

  1. Drag the date filter (using the dark gray handle that appears when you click on the title of the Date filter box) to right underneath the title, such that it extends across the top of the dashboard. 
    Date filter with dark grey handle highlighted
    You might need to resize its height. 
    Dashboard with Date filter moved and resized

  1. Similarly, drag the Selected Metric parameter and position it so that it occupies half of the row that Date currently occupies. 
    Dashboard with Select metric parameter moved

  1. Finally, drag the Country_Region filter into the same row and resize the widths of all three boxes so that they have equal space. There should be three filters all at the top of the dashboard under the title. You might need to resize the visualizations after doing this, as the filters might squish the first bar graph a bit.
    Dashboard with Country_Region filter moved

  1. Remove the Case_Type and Log of Metric Switch boxes on the right by clicking on them and then clicking on the X that appears in the top left corner of the box.
    Removing Case_Type and Log of Metric Switcher filters

  1. Click on the CasesbyDay container, and then click on the More Options arrow from the dark gray menu on the left. Uncheck Title.
    CasesbyDay with More Options button highlighted
    CasesbyDay More Options with Title selected
    Repeat this step for the Map and CasesbyCountry containers. 

  1. From the Objects pane on the left, drag Blank space to the left side of the row with the first bar graph. Repeat with the row immediately under: the map. Adjust the blank spaces so that they are aligned – they should snap into alignment - and take up approximately the left 15% of the dashboard. Use these blank spaces to try to align the centre line of all 3 visualizations. Consider switching into Presentation Mode (by pressing F7 and using the ESC key to exit) to better assess the overall look.
    Dashboard with blank space being dragged to two locations

  1. Finally, let’s apply the Country_Region filter to the first two visualizations. Click on the Country Region filter, and then click on the More Options arrow from the dark gray menu on the left. Under Apply to Worksheets, select Selected Worksheets... 
    Country_Region filter dropdown menu
    Select everything except CasesByCountry.
    Filter popup window with CasesbyDay and Map checked off

  1. It’s time to test your dashboard. Change between a few different countries. Hover over the proportional symbols in the map to see the count of cases. Under Switch Metric, switch between Total Cases and New Cases. Ensure that everything is working as expected; if not, consider retracing your steps with the problematic worksheet.
    Testing dashboard by changing Switch Metric, New Cases, and the map tooltip

  1. Change Country_Region back to (All) and under Select Metric, return it to Total Cases.  

  1. Right click on the Dashboard1 tab at the bottom of the screen, and select Hide All Sheets. 
    Dashboard with Hide all sheets highlighted
    This will hide all sheets other than Tooltip and MapTooltip. Right click on each of them and select Hide. 
    Menu for Tooltip worksheet with Hide highlighted
    This ensures that your viewer will only see the main dashboard, and they will not be distracted by seeing the other sheets listed as tabs at the bottom. You might at this point also want to adjust the sizes of your visualizations to even out the display.
    the finished dashboard

That’s it! Your dashboard is now complete. If you downloaded Tableau’s dashboard workbook file from Tableau Public, you will notice that not everything in that file is covered in this tutorial. Feel free to explore further and try to understand and recreate all aspects of the dashboard for your own learning. 

Data format: