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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lcfaria
Helper II
Helper II

Wrong map location with custom shape map

Hello everyone,

 

I need help from the community.

 

I'm working with a custom shape map of Panama and I'm having trouble plotting cities with the same name.

PS: You can find the link to the pbix file below.

 

What is happening is, when I try to plot the city of Las Lomas in the province of Coclé, the map also plots this city in the province of Chiriquí, since there is also a city called Las Lomas in that province.

 

This is my data, it includes information about the province and district:

lcfaria_0-1722036528821.png

PS: I put here just these two examples, but my data is bigger.

 

Here is the result I'm getting, Las Lomas (blue marked below) is appearing in two different places:

lcfaria_1-1722036616343.png

 

Does anyone have any idea how I can resolve this issue?

 

I've tried concatenating the province, district, and city, but it doesn't seem to work on the Shape Map.

 

Link to the file: https://1drv.ms/u/s!At5JlMR_naI1goRQKuhR_rfRYiZEhg?e=ZM6diU

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

If you 'View Map Type Key' in the shapemap options-> Format visual, you'll find a unique code in there on each row.

You have to get that unique code in your data too, so that powerbi can work out how to link your data to the shapemap's keys.

So find yourself a csv file of unique codes, provinces, districts, cities and use Power Query to merge that unique code into your data. It's best to make it a text field if I remember correctly.

Once you've done that, put the code in the Location field well and powerbi should find the correct area.

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

If you 'View Map Type Key' in the shapemap options-> Format visual, you'll find a unique code in there on each row.

You have to get that unique code in your data too, so that powerbi can work out how to link your data to the shapemap's keys.

So find yourself a csv file of unique codes, provinces, districts, cities and use Power Query to merge that unique code into your data. It's best to make it a text field if I remember correctly.

Once you've done that, put the code in the Location field well and powerbi should find the correct area.

Hi @HotChilli 

 

Thank you for your response.

 

Yes, I noticed that, but unfortunately, there was no unique field, except for some automatically generated IDs.

 

So basically, what I did was create a new attribute in QGIS where I concatenated province, district, and city. Then, I did the same in Power BI, and that solved the problem.

 

But the logic was really about having a unique identifier in the Map Key.

 

Thanks for your help.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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