Adding Country Flag Icons in Tableau
This guide explains how to add flag images in Tableau using its feature that allows dynamic image insertion.

When creating a dashboard that compares data by country, displaying the national flag alongside the country name can be an effective way to enhance clarity and visual appeal.
Tableau provides the ability to load web images via URLs, and we can use this feature to show flags for each country dynamically.
Add Web Images Dynamically to Worksheets
At Tableau, we know that images are a powerful tool when analyzing data

Step-by-Step: Adding Country Flag Icons
- Add a 2-letter country code column (Alpha-2) to your dataset.
Join your existing data (which may include country names or 3-letter country codes) with a reference table that includes the Alpha-2 codes.
- Create a calculated field that constructs the URL for the flag image
based on the 2-letter country code.
'https://git.vizney.com/country-flag-icons/rectangle/'+[Alpha-2]
+'.svg'

- Assign an Image Role to the calculated field.

- Use the calculated field in your worksheet
to dynamically display the corresponding flag for each country.
