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.
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
Built-In Geographic Roles
How Geocoding Works
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
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.
The Edit Locations Dialog
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.
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.
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.
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.
Common Mistakes
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?