01 / 20

Geographic Roles
in Tableau

Learn how to assign geographic roles to your data fields and validate locations so Tableau can map your data accurately on interactive visualizations.

Tableau

What Are Geographic Roles?

A geographic role is a metadata label you assign to a field in Tableau that tells the software the field contains location data. When a field has a geographic role, Tableau can automatically geocode (convert names or codes into latitude/longitude pairs) and plot values on a map.

Why Geographic Roles Matter

Automatic Geocoding
Tableau looks up built-in latitude and longitude values so you don't have to supply coordinates manually.
Map Visualizations
The "Show Me" panel unlocks symbol maps, filled maps, and density maps only when geographic roles are set.
Hierarchies
Tableau auto-builds geographic hierarchies (Country > State > City) letting you drill down on maps.

Built-In Geographic Roles

Geographic Role Country State City Zip Code County Airport Area Code CBSA/MSA Latitude Longitude Custom MOST COMMON SPECIALIZED COORDINATE-BASED

How Geocoding Works

Field Value "California" Geographic Role State Generated Fields Lat: 36.7783 Lon: -119.4179 YOUR DATA YOU ASSIGN TABLEAU GENERATES

When you assign a geographic role, Tableau matches your field values against its built-in geocoding database. It then creates hidden Latitude (generated) and Longitude (generated) fields that power map visualizations.

The Core Rule

This means: if your data has a "City" column, Tableau needs you to confirm it's a City role, not just a string. If it has postal codes stored as integers, you must set the role to Zip Code/Postcode to prevent Tableau from treating them as measures.

How to Assign a Geographic Role

1
Open the Data pane. Locate the field you want to geocode (e.g., "Region", "Zip", "Store City").
2
Right-click the field (or click the field type icon to the left of the name).
3
Select Geographic Role from the context menu.
4
Choose the correct role (Country, State, City, Zip Code, etc.).
5
Check for the globe icon. The field's icon changes to a globe, confirming the role is set.

Auto-Detect vs Manual Assignment

Auto-Detection Manual Assignment
How it works Tableau reads field names like "Country" or "State" You right-click and choose the role
Reliability Only works for common English names 100% reliable when you pick correctly
Custom names Fails for "Sales Region" or "HQ Location" Works for any field name
Best practice Good starting point Always verify and correct

Validating Locations

After assigning a geographic role, Tableau may not recognize every value in your field. When this happens, you'll see an indicator in the lower-right corner of the map showing unknown locations.

MAP VIEW 1 unknown Edit Locations Match values Fix ambiguity Set lat/lon Map > Edit Locations

The Edit Locations Dialog

1
Unrecognized: Tableau cannot find the value in its database. Fix by correcting the spelling or mapping it to a known name.
2
Ambiguous: Multiple matches exist (e.g., "Portland" could be Oregon or Maine). Resolve by setting the Country or State context.
3
Manual coordinates: For truly custom locations, enter exact latitude and longitude in the dialog or use a separate lat/lon field.

Example 1: State Sales Map

You have a dataset with columns "State" and "Revenue". You want a filled map of the US colored by revenue.

1
Verify the role: Right-click "State" and confirm Geographic Role is set to State/Province.
2
Double-click "State" in the Data pane. Tableau auto-generates a map with state boundaries.
3
Drag "Revenue" onto the Color shelf to produce a gradient-filled map.
4
Check the bottom-right: If all 50 states match, there will be no unknown indicator. Done.

Example 2: Zip Code Gotcha

Your CSV has a column "Postal Code" with values like 01002, 90210, 10001. But they imported as integers, stripping leading zeros.

Before (Number) 1002 90210 10001 FIX After (String + Role) 01002 90210 10001

Example 3: Ambiguous City Names

Your dataset has a "City" column with "Springfield" appearing multiple times. There are 34 cities named Springfield across the United States.

!
Problem: Tableau plots Springfield to Illinois by default, but your data includes Springfield, MO and Springfield, MA.
1
Solution: Ensure your data has a "State" column with the geographic role set to State/Province.
2
In Edit Locations: Set the State/Province dropdown to your State field. Tableau uses it as context to disambiguate.

Custom Geocoding

When Tableau's built-in database doesn't include your locations (e.g., internal office codes, store IDs, or non-standard regions), you need custom geocoding.

Option A: Lat/Lon Fields
Add latitude and longitude columns to your data source and assign them the Latitude and Longitude geographic roles.
Option B: Import Custom Geocoding
Create a CSV with your location names and coordinates, then import via Map > Geocoding > Import Custom Geocoding.

Common Mistakes

✕ Wrong Data Type
Zip codes imported as numbers lose leading zeros (01002 becomes 1002). Always convert to String first.
✕ Skipping Validation
Not checking the "unknown" indicator means some data points are silently missing from your map.
✕ No Hierarchy Context
Assigning "City" role without a State or Country field causes ambiguous matches like "Portland" going to the wrong state.

Geographic Roles Summary

Task How Result
Assign a role Right-click > Geographic Role > Choose Globe icon appears
Validate locations Check bottom-right indicator on map 0 unknown = all matched
Fix ambiguity Map > Edit Locations > Set context Correct placement
Fix data type Right-click > Change Data Type > String Leading zeros preserved
Custom locations Add lat/lon fields or import geocoding Custom points on map

Question 1 of 5

What does assigning a geographic role to a field in Tableau do?

Question 2 of 5

Your Zip Code field imported as an integer. The value 01002 appears as 1002. What should you do first?

Question 3 of 5

Your map shows an indicator saying "3 unknown" in the lower-right corner. What does this mean?

Question 4 of 5

You have a "City" field with values like "Portland" and "Springfield" that appear in multiple US states. How do you resolve the ambiguity?

Question 5 of 5

You need to map internal warehouse codes (e.g., "WH-101", "WH-202") that are not in Tableau's built-in geocoding database. What is the best approach?