How to use the Distance calculations in Tableau Desktop 2019.4 and newer.
Tableau 2019.3 lets you calculate the distance between two points directly, no external pre-calculation required.
- The DISTANCE function takes a start point, an end point and a distance unit such as 'kilometers'
- Use MAKEPOINT with latitude and longitude to create the start and finish points the function references
- Tableau calculates distance 'as the bird flies' — a straight line, so treat it like a radius between two points
- You can drag the distance measure onto columns and add trip ID to build a bar chart, then use it as a filter
- This removes the need to pre-calculate distances outside of Tableau
Tableau's DISTANCE function calculates the distance between two spatial points directly in a calculated field, removing the need to pre-calculate distances outside Tableau before importing data.
The example uses taxi trip data with pickup and drop-off coordinates. Latitude/longitude pairs have already been turned into spatial points using MAKEPOINT, which the DISTANCE function then references.
- Create points with MAKEPOINT first 0:00
Before you can measure distance, you need two spatial points to measure between. Build these using MAKEPOINT fed with a latitude and longitude field pair — one for the start location, one for the end.
- Write the DISTANCE calculation 0:20
Create a new calculated field and start typing 'distance' — Tableau will surface the DISTANCE function. It needs three arguments: a start point, a finish point, and a unit.
- Reference the two points and set units 0:42
Type or autocomplete the names of your start and end point fields, separated by a comma, then specify the distance unit in single quotes, such as 'kilometers'.
- Understand it's a straight-line distance 1:05
Tableau calculates distance 'as the bird flies' — a straight line between the two points, not a routed or road distance. Treat the result more like a radius than an actual travelled path.
- Visualise and filter with the result 1:21
Drag the new distance measure onto columns and add an identifying dimension, like a trip ID, to build a bar chart of distances across records. You can also use the distance field as a filter and put it on detail to work with it like any other measure.
- Skip external pre-calculation 2:01
This capability means you no longer need to calculate distances outside Tableau before loading your data — even if a dataset already contains a pre-calculated distance field, you can derive it directly from coordinates instead.
- The distance is a straight-line ('as the bird flies') measurement, not a road or route distance, so it will differ from real-world travel distances.
Reach for this when you have latitude/longitude pairs for two locations per record — like pickup/drop-off, store-to-customer, or site-to-site pairs — and need distance as a measure without pre-processing the data elsewhere.
How this Rollup was made provenance & method
A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.
- Transcription
- On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
- Drafting
- Claude Sonnet 5 in the cloud, from that transcript.
- Prompt
- The exact Rollup prompt (v2) — the full system prompt, unedited.
- Source video
- Watch on YouTube
- Drafted
- 5 July 2026 at 09:38
- Reviewed & edited
- 5 July 2026 at 09:41 · by Tim Ngwena
Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.
Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.