Forum Discussion
custom map doesn't display properly
- 3 months ago
I had been using QGIS on a Mac, so I tried it instead on Windows and it finally worked. And the map works in all 3 projections in Power BI.
Hi mappr,
The "projected from a single point" visual is a classic symptom of a quantization/transform issue in the TopoJSON file. When Mapshaper exports with quantization enabled (which is the default), it encodes coordinates as integers with a transform object (scale + translate). Power BI's Shape Map visual does not handle this transform correctly and collapses all polygons toward a single origin point.
Here are the steps to fix it:
1. Re-export from Mapshaper without quantization
In the Mapshaper CLI or web interface, export using the no-quantize flag:
mapshaper sask2.shp -o format=topojson no-quantize sask2.json
This ensures coordinates are stored as plain floating-point longitude/latitude values, which Power BI can read correctly.
2. Alternative: Export as GeoJSON first from QGIS, then convert
In QGIS, export your layer as GeoJSON (CRS: EPSG:4326), then convert in Mapshaper:
mapshaper sask2.geojson -o format=topojson no-quantize sask2.json
3. Set the projection in Power BI Shape Map
After loading the corrected TopoJSON, in the Format pane > Map settings, set Projection to Equirectangular (not Mercator), which is the correct setting for unprojected WGS84 (EPSG:4326) coordinates.
4. Verify the key field
Use Format > Map settings > View map type key to confirm that the CDUID values in your TopoJSON match exactly the values in your data table's Location field.
The root cause is almost certainly the quantization. Re-exporting with no-quantize should resolve the display issue immediately.
Hope this helps!
- mappr3 months agoNew Member
Hi Freginier
Thanks so much for taking the time to respond and provide detailed instructions!
I tried exporting in mapshaper using the no-quantization option, and I checked the outputted json file in a text editor that it no longer contains "transform". However, it still looks the same when I load it into Power BI.
Any other thoughts?
Thanks so much again!
- mappr3 months agoNew Member
I had been using QGIS on a Mac, so I tried it instead on Windows and it finally worked. And the map works in all 3 projections in Power BI.
- v-pnaroju-msft3 months agoCommunity Support
Hi mappr,
We are pleased to learn that your issue has been resolved. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
- kushanNa3 months agoSuper User
Hi mappr
Is it possible for you to share the shapefile ? so that someone can look into it, recreate the issue, and find a solution?
- mappr3 months agoNew Member
Originally, I used QGIS on a Mac to create the shape file for importing into mapshaper and had the problem as described, even after trying the no quantize specification.
So I tried instead to use QGIS in Windows and found that the custom map now displays properly in Power BI with all three projections, and I didn't have to use the no quantize option.
So maybe it's an issue of QGIS on the Mac.
Thanks again for taking the time to respond!