Skip to content

How to Visualise Data in Tableau

This tutorial will introduce you to Tableau and data visualisation. It will use an example of data downloaded from Destasis, Germany’s Federal Statistical Office, to visualise Germany’s 2020 International Trading Partners by Turnover, Export and Import values. You can access the original and the latest data from this page or download its transformed version in a CSV format here.

Step 1: Import and Inspect Data File

Before you can start visualising data, import the data file. Tableau makes it very easy by listing possible data sources on the left side of the first screen. As our data file is in a CSV format, click on the Text file source and select the data file you want to import.

After a while, you should be able to see a data file extract with the following three columns:

  • Country: An origin/destination from/to which Germany imports/exports its goods
  • Activity: A category of trade, e.g. Imports, Exports or Turnover
  • Eur(000): The value of the trade activity expressed in 000s of Eur.
importing germany trade csv file into tableau example

Step 1: Example of Importing a CSV File in Tableau

After you have inspected and understood the data set better, it’s time to use Tableau to visualise the data on a map.

Step 2: Set Up Your First Tableau Sheet

To set the data visualisation, click on the Sheet 1 tab at the bottom of the screen. You should now see an empty Tableau workspace divided into the following sections:

  • Sidebar: The left part of the screen where you can find the names of the data fields. Notice that most labels correspond to the columns in the original data set. You should also see additional fields like Latitude and Longitude. Tableau automatically generates them, and they will help display the Countries in the correct position on a map.
  • Marks: This is where you can drop one of the data fields to start your visualisation and analysis. We will primarily use the Color and Text marks, but you can drop the fields onto others to see how it affects your visualisation.
  • Workspace: That’s the largest area of the screen. Notice Columns and Rows at the top of the screen. We will use them in the latter part of this tutorial to create a Tableau table.
  • Filters: Here, you can drop one of the Tableau fields to limit the number of values displayed and set conditions for their selection.
setting up a new tableau data visualisation sheet

Step 2: Example of Setting Up a New Sheet in Tableau

Note how Tableau assigns different colours to the fields. For simplicity, assume that the blue labels in our example correspond to descriptive values such as labels (e.g. country name), and green ones correspond to measure values (e.g. trade value). To learn more about the difference between green and blue fields, visit this Tableau’s webpage.

Step 3: Use Tableau Map to Visualise Geographic Data

Drag and drop the Country field into the middle of the empty workspace to display your Tableau data on a map. After a short moment, you should see a map with several dots spread across it. While this is a good start, you want to make the visualisation more meaningful. Drag the EUR(000) field from the sidebar and then drop it onto the Color mark. Consequently, you should see that Tableau has now filled the map with different colours.

Upon inspection of the map, you should notice that the colour’s shade corresponds to the trade’s total value. For example, dark blue relates to the highest numbers. Therefore, you can already see that the biggest of Germany’s trading partners in 2020 were China, the Netherlands, the United States, France and Poland.

setting up data map visualisation in tableau example

Step 3: Example of Setting Up a Map Visualisation in Tableau

Notice that some of the countries on the map, for example, Libya, are blank. There is also a “21 unknown” text displayed at the lower right corner of the Tableau map. The missing colour and the notification indicate a mismatch between the country names from the original data file and what Tableau would expect to see.

To assign the missing locations to the correct value, go to Tableau’s Map menu and click Edit Locations… You should now see a list of territories with Unrecognised red text in the corresponding Matching Location column. Click on one of them and start typing the country name to find the right match. Once you have finished, click OK, and you should see that the map now displays the locations as expected.

Step 4: Add Filters to Improve Your Data Visualisation

Let’s use a filter to add an ability to visualise data based on a selected value. To add a filter in Tableau and limit the selection to just one category:

  1. Go to the sidebar and drag a relevant field (in our example, this will be Activity) and drag it into the Filters pane.
  2. Right-click on its name and select the Show Filters option. You should see the list of activity names on the right of the screen.
  3. Click on the black arrow to the right of the filter title and then choose Single Value (dropdown).
setting a single value dropdown filter in tableau

Step 4: Example of Creating a Single Value Drop-Down Filter in Tableau

Consequently, you should see a drop-down menu with a list of the Activities. Iterate between Turnover, Export, and Import to test how your selection affects the Tableau map’s visualisation.

Step 5: Create Parameters and Combine Them with Filters

In the following steps, we want to keep the existing Tableau map visualisation but display trading partners of Germany with the highest turnover only. Firstly, create a Top N parameter to limit the number of countries displayed. To create a parameter in Tableau:

  1. Click on the black arrow on the sidebar, just above the Tables title, and select Create Parameter…
  2. Type in Top N as the name field at the top of the Parameter Window.
  3. Choose Integer as the data type, set the Current Value to 5 and then pick Range from the list of Allowable values.
  4. In the Range of Values section, check the Minimum box and set it to 0. Then, set the Maximum to 250 and Step Size to 5.
creating a Tableau parameter example

Step 5: Example of Setting Up a Parameter in Tableau

Click OK and then go to the parameter’s name in the lower-left corner of the Tableau screen. Right-click it and then select Show Parameter from the menu. You should now see a Top N slider under the Activity Filter.

Step 6: Make Tableau’s Data Visualisation Dynamic

If you change the values in the Top N slider, you will notice that it currently doesn’t affect how the map displays the data. To make Tableau’s dynamic, link the parameter with a new filter.

To combine the Top N Parameter with a Country filter:

  1. Add the Country field to the Filter pane. Right-click on it and select Edit Filter from the menu.
  2. Select the Top tab in the Filter window.
  3. Click on the Field Option and replace number 10 with the Top N.
  4. Select Eur(000) from the list below, and ensure you selected Sum in the field to the right.

Click OK. As a result, changing Top N should now affect the number of countries displayed on your Tableau map.

combining tableau filter and top n parameter example

Step 6: Example of Combining a Top N Parameter and Filter in Tableau

Step 7: Create a Table to Complete Data Visualisation

Let’s set up a Tableau table to aid in map visualisation. We want to display the trade categories’ breakdown and their corresponding values. To create a new Tableau sheet, click on the + icon, which you will find next to the current tab. As a result, you should now see an empty Tableau workspace.

Creating a table in Tableau is similar to building a Pivot Table in Microsoft Excel. Drag and drop the Country field into the rows section to display the country names in the first columns. Then, place the Activity field in the Columns section to expand the table to add other columns with activity names. Finally, drag the Eur(000) field and drop it in the space below the headers to display the values in the Tableau table.

You should now see a Tableau table with the Country names listed to the left, followed by Export, Import and Turnover columns. To rearrange the columns’ order in Tableau, click and drag the Turnover header and move it to the left.

Finally, go to the Turnover header and click on the symbol (three lines) to rearrange the table. The table should now show the countries with the highest trade turnover first.

germany trading countries data table visualisation

Step 7: Tableau’s Table with Germany’s Trading Partners Sorted by Turnover. For the latest source data, visit Destatis.

Notice that changing the Top N parameter only affects the Map visualisation, while the Country list in the table stays the same. To change it and apply the same Tableau filter to both sheets, return to the filter’s pane in the Map sheet. Then, right-click on the Country field and select Apply to Worksheets… Finally, choose the Selected Worksheets option, tick the box next to the Map sheet, and click OK.

Step 8: Visualise Data with Tableau Dashboard

Let’s create a dashboard to bring the two Tableau sheets into one place. We want to show the map and data visualisation on the top and the table below with Germany’s Turnover, Export, and Import values.

To create a Tableau dashboard:

  1. Click on the New Dashboard icon at the bottom of the window.
  2. Adjust the dimensions of the Tableau dashboard by clicking on the Size values in the left pane.
  3. Choose Generic Desktop to adjust the dashboard’s width.

Drag and drop the map sheet to the top of the new tab, then place the sheet with the countries table beneath it. Then, right-click on the table window, select Fit and click on Fit Width to adjust the window size automatically.

Finally, right-click on the Map sheet name and click Hide Title. Repeat the same step for the Table sheet. To add a title to the dashboard, go to the toolbar, click on Dashboard and select Show Title. Then, Double-click the header and change it to Germany’s Trading Partners by Turnover.

germany trade data visualisation dashboard

Step 8: Germany’s Top 10 Trading Partners – Example of Tableau’s Dashboard. For the latest data source, visit Destatis.

You can also use a table to change the number of countries on the map. For example, to turn the Table sheet into a filter, go to the upper-right corner of the dashboard’s window and select the Use as Filter icon. Then, hold a Ctrl key and click on the country names to display them on the map.

Summary: From a CSV File to a Data Visualisation

This tutorial has taken you through taking a simple CSV file and converting it into a meaningful data visualisation in Tableau. First, you downloaded a data file with Germany’s international trading partners’ numbers and imported it into Tableau. Then, you visualised the country data using the created field.

In the next step, you made Tableau’s map more interactive by adding filters and combining them with parameters. As a result, you could visualise the data by category and limit the number of countries to the most significant contributors to Germany’s trade balance.

You then created a dashboard to finalise the visualisation. First, you set up a separate table that explained the numbers in more detail. Then, you brought the Tableau sheets onto a dashboard. Finally, you turned the table sheet into a filter to make the dashboard more dynamic.

 

Get in Touch

challengejp_data_analystHi, my name is Jacek, and I love spreadsheets! I hope you’ve enjoyed reading this tutorial as much as I did writing it. If you have any questions about Tableau and data analysis, don’t hesitate to get in touch.

Explore my other tutorials to learn more about data or financial analysis. If you need further support, find out about my One-to-One Training and Data Analytics Services.

 

Learn More

Learn How to Become a Self-Taught Data Analyst – In this post, I share my experiences and tips on how I have taught myself Data Analysis.

How to Analyse Data in Microsoft Excel with Power Query and a Pivot Table – This tutorial will take you through a step-by-step process of using Power Query and a Pivot Table to analyse data in Microsoft Excel.

How to Use Python and Pandas for Data Consolidation and Transformation – If you are unfamiliar with Python, this tutorial will show you how to write simple scripts to consolidate and manipulate small and large data files.

Your First Steps in Microsoft Excel Beginner’s Crash Tutorial – This tutorial will give you a quick overview of the main functionalities and formulas and show you how to set up your first spreadsheet.

Leave a Reply

Your email address will not be published. Required fields are marked *