# Hexbins & Mapping in Tableau: Tutorial HD with CC June 2016

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2016-06-26
- **Format:** Video · 17 min watch · transcript available
- **Topics:** Data visualisation
- **Tools:** Tableau (calculated fields, hexbin, maps, parameters)
- **Canonical:** https://just-tim.com/posts/hexbins-mapping-in-tableau-tutorial-hd-with-cc-june-2016
- **Watch:** https://youtu.be/RdIRxS55zQo

I show you how to create hexbins in Tableau, both on an X and Y axis and on a geographical map using latitude and longitude. I cover the HEXBINX and HEXBINY functions, using a parameter to control density, and applying custom hexagon shapes.

## Key takeaways

- Hexbinning requires Tableau version 9 onwards and uses the HEXBINX and HEXBINY functions, which both need to be defined together for the X and Y axes (or lat and long)
- After creating the hexbin calculations, move them from measures to dimensions, then convert them to continuous when placing them on the visualisation
- Use a parameter multiplied into and divided out of the calculation to control bin density on the fly without rebuilding calculations
- For maps, treat latitude and longitude as your X and Y values, and assign the duplicated reference fields the correct geographic roles
- Hexagons are used because they are the most compact way to fit shapes side by side, the same reason honeycombs occur in nature

## Chapters

- 0:00 Why hexbins and the distortion problem
- 0:52 The sample data and version requirements
- 1:48 Understanding the HEXBIN functions
- 2:53 Building X and Y hexbin calculations
- 5:31 Controlling density with a parameter
- 9:24 Applying custom hexagon shapes
- 11:10 Hexbinning on a map

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/hexbins-mapping-in-tableau-tutorial-hd-with-cc-june-2016

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
