Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
maiios
Frequent Visitor

How do you generate a map with census tracts

I have a dataset with each row assigned a census tract. I am trying to generate a map with each census tract in our city, and have the color change based on the number of rows that report as part of that census tract. How do I do that?
1 ACCEPTED SOLUTION
maiios
Frequent Visitor

While @amitchandak and @V-lianl-msft were exactly right about using the Shape Map, I wanted to expand the answer a bit. For my problem, I needed to create a map of census tracts in my city, which requires a few extra steps.

 

1. Enable the shape map as described here: https://docs.microsoft.com/en-us/power-bi/visuals/desktop-shape-map

2. Next, you will need the map you will use as the basis for your map. In the United States, the Census has lots of shapefiles for various kinds of maps. Pick your map here: https://www.census.gov/cgi-bin/geo/shapefiles/index.php

3. If applicable, crop your map using QGIS (directions: https://danielcorcoranssql.wordpress.com/2017/08/08/qgis-cropping-and-converting-shp-files-to-topojs...).

4. Create a shape map, and use the topojson file that you created in step 3 (the process for adding it is in the link in step 1)

 

I had some issues where the map was completely blank when I imported it into the shape map. I had to play with the way I saved the data from QGIS. Specifically, I had to try some of the different options in the 'Save Vector Layer As' window, and change the CRS dropdown. I got it to work after trying all four options, and getting one to work. I don't know enough about this stuff to understand what I was doing, but I got it to work. 

 

Thanks for everyone's help!

View solution in original post

5 REPLIES 5
maiios
Frequent Visitor

While @amitchandak and @V-lianl-msft were exactly right about using the Shape Map, I wanted to expand the answer a bit. For my problem, I needed to create a map of census tracts in my city, which requires a few extra steps.

 

1. Enable the shape map as described here: https://docs.microsoft.com/en-us/power-bi/visuals/desktop-shape-map

2. Next, you will need the map you will use as the basis for your map. In the United States, the Census has lots of shapefiles for various kinds of maps. Pick your map here: https://www.census.gov/cgi-bin/geo/shapefiles/index.php

3. If applicable, crop your map using QGIS (directions: https://danielcorcoranssql.wordpress.com/2017/08/08/qgis-cropping-and-converting-shp-files-to-topojs...).

4. Create a shape map, and use the topojson file that you created in step 3 (the process for adding it is in the link in step 1)

 

I had some issues where the map was completely blank when I imported it into the shape map. I had to play with the way I saved the data from QGIS. Specifically, I had to try some of the different options in the 'Save Vector Layer As' window, and change the CRS dropdown. I got it to work after trying all four options, and getting one to work. I don't know enough about this stuff to understand what I was doing, but I got it to work. 

 

Thanks for everyone's help!

V-lianl-msft
Community Support
Community Support

Hi @maiios ,

 

Refer to shape map.

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-shape-map 

It may cause some performance issues.

ArcGIS map and mapbox can also be choices.

ArcGIS map will not work with embedded.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@maiios , In case you have Pincode ,lat/long or JSON coordinates. You will able to create some kind of MAP. For shape, you need have shape json.

refer these for Map Json - Shape Map
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-shape-map
https://dataveld.com/2016/09/12/topojson-map-files-for-power-bi-shape-map/
https://medium.com/weareservian/power-bi-custom-maps-part-ii-shape-map-939873da3f66
https://radacad.com/shape-map-better-than-the-filled-map
https://doc.arcgis.com/en/maps-for-powerbi/get-started/prepare-your-data.htm

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

HI @maiios 

 

For the census tract in our city, to plot it on a map, you need some field which you can determine what is the location of the census.

My best bet will be on longitude and latitude or pin code(Zip code). Once you have it you can use it in the Map visual.

and in the legend section you can have the count of it.

 

pranit828_0-1597975077075.png

pranit828_0-1597975265887.png

 

 

lbendlin
Super User
Super User

what is a "tract"  - is it a geojson or topojson string that identifies an area?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.