Morning! Adam here with this week's issue of Power BI Plays.
When I create reports for clients that incorporate maps, I always get a "How did you do that?" or better yet, "What did you use to build this?"
And the honest truth is that it's straightforward. Mapbox. Once you set it up once, you'll never go back. Let's get it.
Power BI stock map visuals are extremely underwhelming.
Switch to Mapbox and watch your reports come to life. Instead of using words to prove it, I'll show some images.
Simple, elegent, no contest.
1. Head to https://account.mapbox.com/auth/signup/ and create an account - it's free.
2. Note your Default Public token located on the Account page within Mapbox (first/home page). You can either use this or create report-specific tokens:
3. Head over to Power BI Desktop and Install the Mapbox Power BI visual into by clicking the three dots under the visuals panel and selecting "Get more visuals:
Search "Mapbox" in the top right, then select the thumbnail.
Click "Add," and the visual will now be available to use.
4. Back in Power BI Desktop, drag and drop the visual onto your canvas and open Format > Viz Settings. From here enter your Access Token from MapBox (Step 2 above) and ensure your settings look like mine (we're trying to emulate the pictures above but feel free to play around with the settings - you won't break anything).
5. Next, head down to "Choropleth" and ensure it's switched on. Also, make sure you only have one option selected here (i.e. turn all other options off).
Here you can change your map styling, zoom, and the actual map contained in the visual. For our purposes, choose "Level 1" for Level and "Global Countries" for Data Level 1. This configuration will give you a standard world map which is a great starting point.
For your data to appear correctly on a Mapbox map, you must use Mapbox's naming conventions. Now this is in no way the correct country name - it simply matches your data to the Mapbox visual.
At the time of writing, it was a little tricky to find this list as the instruction pages are no longer available. So here it is; I have also made a coit, so if this disappears, let me know.
https://docs.google.com/spreadsheets/d/1k5HvzWdeuELwnL-Ta1Jt7wghOOrRpmQU438_LfohBEI/edit?pli=1#gid=0
Use this file to reference your country name. If your country name doesn't match the corresponding name in this file precisely (capital letters, commas, etc.), it will not appear on the Mapbox visual.
Once mapped, it should look a little something like this:
This article only scratches the surface of Mapbox's capabilities.
Built into Power BI are a world map and a USA map but should you need custom maps (like the China map above), you will need to create your own tileset.
I will start to create some video tutorials to run through creating custom tilesets and applying them to Power BI reports.
For now some further reading:
Here is the current Mapbox tutorial: Mapbox
Here is the old tutorial specific to Power BI: Wayback Machine
That wraps up this week's edition of Power BI Playbook's Power BI Plays.
I hope it helps, and as always feel free to email or DM me any time.
Adam
TL;DR:
Look at you go you mapping genius, you.