Search code examples
looker-studio

Map Postal Codes from BigQuery to DataStudio


I have Postal Codes in BigQuery as strings and I'm trying to map them in DataStudio.

When I do this for States and set the Geo Dimension as Region Code it works flawlessly.

But, when I do this for Zip Codes and set the Geo Dimension as Postal Code it loads the number in the legend bar (see graphic below) but it:

  1. Doesn't map any of the points and
  2. Doesn't allow me to select a Zoom Area

enter image description here

When I try to select the Zoom area, it states:

This map needs a valid geo dimension before you can set the zoom area.

How can I map Postal Codes (stored as strings) from BigQuery to DataStudio?


Solution

  • 1) Postal Codes

    Postal Codes are currently supported in the Google Maps Chart.

    Adding an image from the Geo dimension reference Support Page for future reference:

    Google Data Studio Report and a GIF to elaborate, using Postal Codes in the United States with Google Maps and Geo Maps:

    2) Latitude Longitude

    Whilst Postal Codes are currently supported in Google Maps, a Latitude, Longitude dimension is supported in both (Google Maps and Geo Maps), thus one approach is to link a Latitude, Longitude value to the respective Postal Code field.

    I'll run through a possible workflow in Google Sheets to demonstrate:

    1. Download data from public.opendatasoft.com (US Zip Code Latitude and Longitude) (has over 40,000 rows of data on Postal Code and a respective field in Latitude, Longitude);
    2. Use the VLOOKUP function to link the Postal Codes from the current Data Set and public.opendatasoft.com (US Zip Code Latitude and Longitude) and then add the Latitude, Longitude values; have a look through the Editable Google Sheets for clarification;
    3. Filter Control: Add the component and set the Postal Code field as the Dimension;
    4. Geo Maps: Add Latitude, Longitude as the dimension and use the Filter Control to display the required area.

    Added a New Page to the Report and a GIF to demonstrate: