Forum Discussion
Mapbox visual with multiple countries does not zoom in to the selected country
Hi Malick - Your issue with the Mapbox visual in Power BI not zooming in automatically to the selected country is likely related to the configuration of the "comp_key" field and its interaction with Mapbox’s dynamic zoom functionality.
In the Power BI Mapbox visual, make sure that “Auto-Zoom” is enabled in the visualization settings if this option is available. This setting ensures that the map zooms into the area relevant to the filter selection.
If you don’t see an “Auto-Zoom” option, check if Mapbox updates have introduced any specific instructions on how to use location-based zoom with Power BI.
Mapbox doesn’t automatically recognize filters from Power BI to trigger zooming. You can try using a Power Automate integration to explicitly control the map view, but that requires custom scripting.
Mapbox provides documentation on using custom tilesets and Power BI integration
below link FYR:
Tilesets | Mapbox Docs | Mapbox
If these steps don’t resolve the issue, there may be a limitation in the Power BI integration with Mapbox, and you could consider reaching out to Power BI or Mapbox support for further assistance.
Hope this information helps.
Thanks for replying rajendraongole1 . The auto zoom is enabled. I have tried importing a new tileset with just the country boundaries to see if the issue was with the 'comp_key' which is a unique identifier for each location in the tileset, but unfortunately, the zoom in does not work with country boundary as well. I wonder if there is any solution to this problem or should I be using another approach / visual type to show data at sub-national level.
- rajendraongole12 years ago
Super User
Hi Malick - Since auto-zoom and using the comp_key as a unique identifier for each sub-national location haven't resolved the issue, it might indeed be worth exploring alternative visuals or approaches.
alternatives like ArcGIS Maps for Power BI and Drill Down Map visuals are likely the most straightforward alternatives if automatic zooming with slicers is essential for you. These alternatives often provide better zooming and filtering at sub-national levels without extensive setup. Let me know if you'd like detailed guidance on any of these specific approaches!
Feel free to mark the right answer as solution and I wouldn't mind kudos. thank you
- Malick2 years agoRegular Visitor
Thanks for the advice. I'll appreciate if you can provide guidance or point me to the online resource on both atcgis and drill down maps usage in Power BI.
- rajendraongole12 years ago
Super User
Hi Malick - Please find the details.
Add the ArcGIS Maps for Power BI Visual:
Open Power BI Desktop and go to the Visualizations pane.
Look for the ArcGIS Maps for Power BI icon and click on it to add it to your report.
Prepare Your Data:Ensure your dataset includes geographic data, such as Country, State/Province, or City.
For sub-national boundaries, you may have a column with unique identifiers for each region, such as comp_key for the specific areas within each country.
Configure the Location Field:In the Location field well, add your location data (e.g., Country, Region, or comp_key for specific sub-national regions).
ArcGIS Maps will automatically recognize many geographic fields (such as country names or ISO codes) and assign locations accordingly.
Customize the Map with Layers and Filters:Use the Layer List option to add data layers, such as boundary layers or points.
To zoom into a specific country or region based on slicer selection, ensure Auto Zoom is enabled in the map settings. This should allow the map to automatically adjust its zoom level when a filter is applied.
Use Boundaries and Styling Options:In the Map tools section, you can choose Boundaries to show borders for countries, regions, or custom shapes.
Under the Symbology section, adjust the color scheme and range based on your severity scale (1–5).
Add Slicers:Add a slicer to your report for filtering by country, region, or other fields.
When a selection is made, ArcGIS Maps for Power BI should zoom into the selected area if Auto Zoom is enabled.Create an ArcGIS map in Power BI - Power BI | Microsoft Learn
https://www.youtube.com/watch?v=-izRcDYGR1g
Drill Down Map by ZoomCharts allows you to interactively drill down through different levels of geographic data, such as country, state, or region. This is a custom visual that needs to be added to your Power BI report.
https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa200002264?tab=overview
https://www.youtube.com/watch?v=91SW4J5rP1k
Drill Down Map by ZoomCharts offers a hierarchical drill-down feature that lets users manually explore different geographic levels. It’s not auto-zooming, but the drill-down interactivity can be useful for exploring detailed data.
Hope this helps