I love maps! – Who doesn’t? – Yet, I often have trouble finding out how to make them do precisely what I want. Here we’ll look at 3 different levels of mapping use case – Mapping 101 (just the basics), Spatial files and how to use them, and finally an introduction to X-Y plots using map layers.
Mapping 101 (just the basics)
1.0 – Your first map
Let’s create your first map from Superstore data (the practice data set that came with Tableau). The easiest way is to drag and drop any GEO file to the canvas. Geo fields can be identified by the globe icon. Tableau already knows the longitudes (longs) and Latitudes (lats) needed.

That was easy enough. Let’s look at the map in more detail.

Tableau created a map of the United States with a circle at the center of each state. The “green pills” on the Rows Shelf (Latitude Generated) and the Columns Shelf (Longitude Generated). They make a nice map, but cannot be used in any calculations, for that you will need to provide your own longs and lats. More on that later.
Note, there is also a message in the lower right corner of the frame that says there are 10 records that Tableau could not plot on the map. Open the message, and there are 3 options – I ALWAYS select Edit Locations first to see what the problem is – Filtering or using a default position may be a solution later, but only after identifying and trying to correct the problem.

When we dragged the State/Province to the canvas, Tableau did not recognize the Canadian Provinces. The problem is easily fixed by adding the Country to the Marks Card.

Now we can see all the Canadian Provinces and no longer see the warning.

Great, but that is not what I wanted to present.
2.0 Map Customization (the basics)
There are many ways to customize the map, but for this example, I only want to be able to see the relative Sales and Profitability in each state. Start by dragging Sales to the Color Tile on the Marks Card.

Our map changed to a filled map, and Tableau applied the default continuous blue color palette.

Now I want to add Profit as a filled shape with the relative size reflecting the overall state profit and a discrete Red–Green palette for negative and positive values.
3.0 Map Layers
This is only a little more complex. Not difficult. We just need 2 maps layered on top of one another. Drag the State/province dimension to the canvas, and a window will open to create an additional map layer.

You’ve created a second layer and a new Marks Card where you can customize the mark type (I selected Shape), bring Profit to Size to reflect the relative profit by state, and place Profit on Color like this to have the red/green – negative/positive color reference.

That also creates a second Marks Card – see setup:

The filled map now shows sales, and in each state, there is an arrow for the relative profit

4.0 Other Use Case Examples
Let's revisit the Sales area map of the US and Canada. The continuous color range starts at 132 (Lightest) and continues to 457,688 (Darkest), making it difficult to distinguish the colors in between.

Starting with the 2025.2 release, a “dynamic color” option will help make that easier. Open the Color tile and Edit – A new window opens that allows you to customize the range while also making it reactive to the view selection.
Select the color palette, as before, from the Dropdown and are given options to accept the default range Start, Mid, and End –
“Automatic” is the full range that you are used to.
“Custom” allows you to key in a constant value.
“Parameter” will base the value on the parameter values.
The Start, Mid, and End options are independent and can be mixed – i.e., Auto for one, a constant, or parameter-driven for others.

You are already familiar with the Automatic setting (you have been using it all along), so here I will show you how to use the parameter values to dynamically adjust to the view. Create 2 parameters – one for the Start value and the other for the End value in the range. Each parameter is based on Sales – nothing special, just give the parameter a name and accept ALL values. Once you have done that, duplicate the parameter and give it a different Name – I used Start Color Range and End Color Range.

Next, reopen the Color tile and edit the Range Start and End to be driven by the parameters.

The last step is to add 2 parameter actions to change the parameter values based on the view selection – use the MAX sales value on the End of the range and the MIN value for the Start.

And the color range based on the state selection results:

For these next examples, I will use this dataset. It’s simple, but it does have issues. Tableau did not recognize ”Locations” as actual Cities, and there is this Airport code I would like to use in the map.

First, let’s convert the airport code to Geo fields and use them directly in a map. Tableau supports many commonly used geographic references. Open the Dimension pill and select Geographic Role – the one we need is right there – “Airport”, but also note that “Congressional Districts”, NUTS codes, CBSA/MSA, and many others are also available.

Now, Tableau can generate the longs and lats and plot the map.

We can reference Locations to Cities, but Tableau can find NYC.

Open the message and see that NYC is not recognized – one way to fix this is to select the red message and select from the drop-down menu.

Now that NYC is back in place, let’s look at different ways to see the population in the 4 cities –
The most frequent choice is to place the population on Size :

Let's look at some other map types, like density, choropleth, or adding in some animation.
For this renewable energy example, I have loaded the wind turbine locations by County in the US and can count the number of turbines or the total power generated. Using the type of shape map from before, the data would look like this:

But it may provide more insight by using a choropleth map showing the power generated by county. Change the map type to Filled and place the Sum of Power on the Color Tile.

Alternatively, you can plot the turbine density by county using a Density plot.

I added a satellite background for impact.

In this final example, I will use pages to show how CO2 emissions change over time by country:
All of these examples were done using the Tableau-generated longs and lats, without any spatial data or calculations. Not difficult to do. Just need some practice.
If they meet your needs, I suggest you stop here, but if you are ready to move on using spatial data, read on.
Spatial Files and How to Use Them.
5.0 What is a spatial file?
In the first section, we were using Tableau-generated longs and lats, which cannot be used in calculations or to combine or intersect data sets. For that, the actual long and lat need to be included in the data, or they may be part of spatial files uploaded to Tableau. No need to feel intimidated. They are just another type of file that Tableau recognizes, which can be used in the mapping process.
Spatial data is an overarching term for data in a variety of formats – Shape Files, KML, GeoJSON, ERSI files, and other Geodatabases – you get the idea – which, when loaded into Tableau, are used to create the points, lines, or polygons in a map.
New users always want to know where they can source spatial data sets. While finding the source with the right data takes some work, there are numerous sources. I always recommend Data.gov as your first stop in the US. It is a portal that provides access to national, state, and regional data. If you are in Canada, try Statcan.gc.ca. Many states or municipalities have sites like https://tn-tnmap.opendata.arcgis.com/ in Tennessee that I used for much of the data used here. Finally, industry or special interest data is searchable. It may take several attempts, and you may need to clean the data before it is usable, so be prepared.
When you download the data to your system or laptop, it may include several separate files. Keep them together in the same folder. They will be needed when you load the single SHP (shape file) to Tableau.

Uploading a spatial file is like loading any other file. From the data tab, “Connect to data” and select Spatial File.

When you navigate to the folder containing the spatial data, you need only the SHP file will appear (but you need all the other files in the folder – do not delete)
5.1 Point file – Starbucks store location example
I’ll start with a point file example, by uploading a CSV file to Tableau (not even a spatial file). The file included all the Starbucks locations by store number, city, store name, and most importantly for our needs, the long and lat. As you can imagine, it was a lot of data, so I added Data Source filters to limit the data to the NYC area.

To create a point map, start by dragging the long and lat to rows and columns (note – it will aggregate as the AVG() – that is what you want) but it is a single point – the average of all the longs and lats of the Starbucks in NYC – Drag the Store number to the Marks card to disaggregate the data.

The result should look like this.

Now get creative. What do you want to know? I want to choose a Starbucks location and have the map show the distance from that location to all the other locations. We need the actual long and lat data for use in a calculation in a spatial file. Wait – we don’t have spatial data yet – because with loading a regular CSV we need to convert the longs and lats to spatial data using a spatial calculation Makepoint()

And a Spatial field is added to the data as a POINT.

Now we need a starting point – a parameter will do nicely – but not just any parameter – here I want a Spatial Parameter – a parameter whose values are the long and lat of a selected point (or other spatial shape) using a parameter action.
Create the parameter by selecting Spatial from the dropdown. It is not preloaded with values and should say Empty for the current value and All values.

To fill the spatial parameter with a value, we need a parameter action.

It is a “change parameter action” using the parameter and the makepoint values we just created (note they are identified as a Collect). Set the value to Empty when the selection is cleared.
Ok (almost there), just need to determine the distance from the selected store to each of the others using another Spatial calculation, Distance.
DISTANCE([Select a Starbucks location from the map],[SB – geo points ],'km')
And for convenience, turn off the highlighting with this filter action.

And finally, use dynamic color to add color ranges.

And this is the result.

That took some work to load a CSV, convert the data to a Spatial Point file, add in a UX to allow the user to select a location, calculate the distance to each store, and then dynamically color code the map – but you learned a lot in the process.
Now let’s load actual spatial files. We will start with 2 spatial files, one with hire bike station locations and the other with ‘Street art’ locations in Metro Nashville. They are loaded as separate files and NOT connected on the data source tab.
The Bike location map looks like this:

The file is a point file, and the map is created by dragging the ‘Geometry’ to the canvas and adding the facility name to disaggregate the data.
The art data is a file which contains the longs and lats which have been converted using the Makepoint() spatial function –
MAKEPOINT([Latitude],[Longitude])
And then plotted as a second layer on the same worksheet:

I want to be able to use a spatial parameter to select a single bike station location and see all the art locations within a parameter-driven radius around the selected station. We need some parameters.
First, the spatial parameter from the Bike Data Set is used to select the bike station (remember to accept all values):

Then, a formula in the Art Data Set determines the distance from the selected bike station to all the art locations. (Note it is important to create the calculations in the proper data set – here we are using a spatial parameter value (selected bike location) and the art location make point spatial data to determine the distance in the ART Location layer of the map) The spatial parameter values from the Bike layer are converted to a geo spatial data in the Art Layer with a simple formula.

Then the distances can be calculated as:
{ FIXED [Title]: sum( distance([selected bike location geo],[art location MP],'mi'))}
Add a parameter action to change the value of the Spatial Parameter (Bike Location)

Add the distance to the Color Tile on the Art card and set the dynamic color range end to the parameter value selected by the user –

And the map is done. The user selects any bike location (I added a 3rd layer with a red star to show the location), the map zooms and centers based on the view radius, and the color code relates to the distance from the bike station to the art.

A lot is going on between the layers; it is a good example of how to relate 2 spatial data sets without combining them.
Up to this point, we have been working with points, but spatial data also comes in lines and polygons. Let's revisit the NYC Starbucks data and see how that can be related to the NYC subway line locations. The subway data type is Linestring.

Drag the geometry to the canvas and the route ID to the marks card, and Tableau will connect the related subway lines.

That looks good! Now I would like to see the Starbucks locations close to each subway line. Start by creating a parameter to set the distance (known as the buffer distance)
I will use the same buffer distance around the Subway Route lines and the Starbucks Points. For now, it is set to 1 – the user can easily change the value.

It is important to have a buffer – seldom will there be an exact match between the spatial longs and lats. The buffer sets the acceptable “close enough” range. We need 2 spatial calculations.
First, the buffer around the subway lines – note the calculation is in the “Subway dataset”, the addition of the Units – here kilometers, and the parameter value, which the user can vary

Similarly, in the Starbucks dataset, the buffer around each location is: Note that the SB Make Point is the spatial data we created in the previous example:

Now we can use another spatial calculation to find the subway and Starbucks that intersect
INTERSECTS([buffer arounds selected subway line],[Buffer Around SB Locations])
It is used to filter the dataset to true on the filter shelf
I’ve created a dashboard with the Subway lines on one chart side-by-side with the Starbucks location in another. – The Starbucks location chart uses a 2025.2 new feature, “Viewport,” to open and zoom to a detailed map of the Starbucks models in the intersection:
Using the cursor, select a single segment to create a rectangle to define an area

The Starbucks map opens, showing all the locations in the selected area.

Pretty cool! It does take work, but it adds a lot to your presentation of the data.
This is just scratching the surface. I suggest that you find some data that interests you and give it a try. Spatial data, calculations, and parameters work similarly to those you are already using. Just a different type of data.
X-Y Plots using Map Layers
Now you probably have seen amazing vizzes during Ironiz and wondered how they did that? It is often done by using maps and map layers to create an X-Y plot. We’ll take a look “behind the scenes” so you know it at the next TC –
When you were in school, you probably made a lot of graphs by laying out an X-Axis and Y-Axis and then plotting points using their X-Y coordinates and connecting the points with lines. (Surprise – that is what Tableau does in the charts and maps you create). Here we are going to look at recreating that process using calculations and placing them on a map. Why the map? You may have run into a problem where you wanted to plot a “combo chart” or add a 3rd mark type to a chart, but you were limited to 2 layers (dual axis). Maps have unlimited layers that Ironviz champions have used to create their unbelievable vizzes.
We are going to look at the process with a couple of straightforward examples. Enough to get you started –
We start by defining a grid for our X-Y plots. We are going to plot them as a geo field, so we will need to relate are actual metric to a relative position on a long and lat grid.

Conceptually, the X and Y axes run from 0 to 100% based on a measure’s proportion to the maximum value in the data set. On long and lat min and max range area up to you, but in most cases, you want them to start at 0,0. You may want a square grid with the max long and lat at 60,60 (for example) or a rectangular grid at 180,90 – Experiment and see what works best with your data.
It is easier to look at an example – I am using Superstore data, but only for 2 years, 2023-2024 data.
I’ll start with the X-Axis (Order Date)
The range (number of dates) is just the difference between the max and min (Note the use of lods)
{max([Order Date])}-{min([Order Date])}
Any point along the axis is the date minus the starting point:
[Order Date]-{min([Order Date])}
Converting that point to a geo field using 180degrees as our max end point (I am aggregating with AVG() to account for multiple lines on an order)
(avg([date increment to any point]) /avg([date range max]) ) *180
Next Y-Axis – Sales at the day level –
The Y-Axis runs from the min daily sales to the max – in this case, we want to start the range a 0, so the range is just the max value
{max( [sales lod at day level])}
For any point, I’ll use this lod to find the sales.
{ FIXED [Order Date]: sum([Sales])}
And the distance along the Y axis is ( I am setting 90 degrees as the max value)
(sum([sales lod at day level])/sum([sales range based on lod ]) ) *90
One more calculation and we are done. Need to create a geospatial field with Makepoint
MAKEPOINT([percent of sales range ],[Percent order date in range])
The rest parallels what we have done so far. Place the geo field on the canvas and disaggregate with date.

To eliminate the background, open the Map tab from the top ribbon:

You can change the level of aggregation for category and date like any other map (but note – you will want to hide the axis headers – the proportions don’t mean anything to your user)

That seems like a lot of work for a simple chart. The advantage comes when we stack charts using map layers –
The advantage that Ironviz competitors found is the ability to place different charts on map layers, positioning them as a single viz.
I am just going to create 3 charts on one worksheet –
The upper portion (lats from 45-90 and longs from 0-180 ) will be a sales trend.
The scatter plot in the lower left takes 0-45 and longs from 0-90.
And finally, the par chart is in lats 0-45 and longs 90-180.

I will take you through the scatter plot in detail – the workbook can be downloaded and contains the details for the other calculations.
The scatter plot is Sales v Profit for Subcategories.
The range of sales values is the difference between the fixed max category sales and the minimum.
{ FIXED :MAX(FIXED [Sub-Category]:sum([Sales])} )} – { FIXED :min( {FIXED [Sub-Category]:sum([Sales])} )}
Likewise, the range for the profit values is:
{ FIXED :MAX( {FIXED [Sub-Category]:sum([Profit])} )} – { FIXED :min( {FIXED [Sub-Category]:sum([Profit])} )}
The location for any subcategory on sales is – (Note the *35 is based on the space dedicated to the plot in the lower left corner of the space – the 35 v 45 allotted provides white space around the plot)
( (sum({ FIXED [Sub-Category]:sum([Sales])})/sum([sales range for scatter – sub cat level ]) ) *35)
We need a position for the Profit value, and it is:
10 + ( (sum({ FIXED [Sub-Category]:sum([Profit])})/sum([profit range for scatter – sub cat level ]) ) *80)
Where the 10 + provides some white space at the left of the chart
The Makepoint calculation is as before:
MAKEPOINT([percent for scatter sales ],[percent for scatter profit])
And the scatter plot is in the lower left portion of the canvas:

Similarly, the other 2 charts can be added, resulting in 3 mark types on a single worksheet –

The IronViz vizzes are more refined and build a better story! Now you know how it is done. I am amazed every time I see them used.
That’s it. It’s your turn, so load some data and try your hand at mapping. Start with maps based on Tableau-generated longs and lats, move on to using different types of spatial data, and please learn to use spatial calculations, spatial parameters, and Viewport functions. I would love to see how you have used them in your vizzes.
The workbook used here can be downloaded from my Tableau Public site at Link to map workbook
Enjoy
Jim

4 Responses
I used your technique to create a scatterplot but when I try to add a trend line to it, it doesn't show up. Do you by chance have any suggestions?
Hi – You are using the X-Y plotting technique – Right? In that approach you create a plot by creating an XY grid and assigning marks a position on the grid and connecting them with a shape or line – You then convert the locations to longs/lats and place them on a map of the world and hide the background. You are not using the native columns/rows plotting capability in Tableau so you would not be able to apply any built in functionality like trend lines or ref lines – You could do it from scratch! Create a calculation to determine the trend based on the x-y position of your marks- convert it to longs and lats and add it as a separate layer to the map
Is there an opportunity for me to share a workbook for an additional nudge with the trend line?
I am going to recommend you visit https://trailhead.salesforce.com/trailblazer-community/neighborhoods/tableau where yoi\u can post yoiur question and share a workbook