Showing results for 
Search instead for 
Did you mean: 

Create Your Own Custom Map for Power BI

Hi, I’m sharing back with community here (I encourage you to do the same as you come across your own useful Power BI tips and recipes)


In this post, I will share how to create a custom map file to use in Power BI.  To start out, add a Shape Map visual to a report in Power BI Desktop:




Once you add this visual you can pick from lots of included maps as well add your own custom map by clicking Add Map.  





That's great, but “Where do I get custom maps or better yet how would I create my own map?” you may ask.   Lots of organizations need custom maps for sales districts, service areas, and regions that don't always align nicely to states and zip codes.     


How to create your own map

Let's walk through the steps to create your own custom maps using Google Maps and a couple open source tools.  When we’re done, you will know how to make a professional looking map that works extremely well with Power BI.


Shape Maps in Power BI use a popular map file format called Topojson.   I first encountered TopoJson when I worked as a D3.js developer.    If you want to learn more about TopoJson/GeoJson you can go here


TopoJson is a JSON file that can be quite complex and lengthy. While you could code one in notepad, that would be no fun at best.  


Luckily Google Maps provides an on-line tool for creating your own custom maps.


Create a custom map in Google Maps

 Go to Google Maps, open "Your Places", Maps, and click Create Map.  Start drawing your own map over the area of the world you are interested in tracing.   I won't go into the details on how to draw a map, but you will find it fairly intuitive and easy.  Use the polygon tool to trace around your custom areas.  


To map data to your shapes in Power BI, you want to name your Polygons EXACTLY as they are in your data.  For example, if in your data you have a [Region Name] field and it has a value of "Western Region", you want to name the Polygon shape you drew in Google Maps, "Western Region" if that's the field you will bind to your map's location property.  


Once you have a saved map, Export to KML.




Pick your map layer instead of the "entire map" and check these options:




Click Download and Save.


Now that you have a KML file (another type of mapping file that is based on XML) we need to convert it to JSON.  We must go through a couple of steps to get it into a format Power BI can use.


KML to GeoJson
You can use tools like to convert KML to GeoJson.  In this tool, you cut and paste the contents of your KML file into the KML window and you will get a GeoJson conversion on the right.  Save the conversion to your workstation in a file with a .json extension. 


GeoJson to TopoJson

 We're not done yet.   Now that you have a GeoJson file, you need to run this through a couple of conversions to get it to look nice and export to TopoJson.    In this example, I'm focusing on getting a custom map of the United States projected as "USA Albers projection" which will, for display purposes, move Alaska and Hawaii and scale them so they can be easily viewed with the other 48 states.


To do this we can use    


Open your GeoJson file you just created.




You should now see your custom map displayed.   


Depending on your map, you need to do a couple of clean-ups before we're ready to save as TopoJson.   


To clean up the file, you need to make sure the map is projected as  WGS84.  To do this, click the Console button (upper-right)




At the command prompt ($), enter the command -proj wgs84


If you want a map in Albers USA projection also enter -proj albersusa


If your shapes render as black, you may want to get a look at the boundaries before finishing.  This command will do this for you.

-svg-style fill="white"


Finally, save the file as TopoJson by clicking export and selecting TopoJson. 


 Click Export and Save.


We're almost done.    I swear!


Open your custom map in Power BI Desktop


Go back to Power BI Desktop and open your custom map in the format properties of a Shape Map visual




Select your previously created TopoJson file.  You should now see your map!   If you wish, you can play around with the different types of projections.  


Last thing you need to do is bind data to your map.  If you properly named your polygons in Google Maps, you should be able to assign your appropriate data field to the Location property of the map, and then assign a measure value to the color saturation.



At this point you should now be feeling like a B.I. rockstar and have a strong urge to show your boss the cool Power BI trick you just learned. 


Enjoy and remember Power BI's Community is one of the main things that makes Power BI a great tool.  Take a tip, leave a tip.


If you made it through all the steps it should work.  If it looked good in you are close.

Impactful Individual
Impactful Individual

Just found this post and it has made my day @mjfulke!!


Tried and failed at working with shape map visualisations but when I created the json file to upload it basically killed the pbix file as I wasn't doing it right.


Been messing around with esri visualisation which nearly does this but in the uk, unfortunately, it does not map 4 of our uk postal code areas correctly.


Just spent 10 minutes following instructions and searching for an appropriate kml file and voila a perfect map that I can attach data too. Many many thanks! 

You're welcome @gooranga1!


Thank you for sharing.  This is complicated topic and you explained it clearlly and thoroughly.  The PBI community is very appreciative.


Keep up the great work

Thank you for the information. Can we create total world map except ocean region as custom?

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.