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

How can I calculate the province column using country, city and postal code

Hi, 

I have created a geographic map in Power BI using country, city, and postal code. Now, I want to segment the map based on provinces, but this field does not exist in my dataset. I would like to know if there is a way to calculate the province field from the other fields using an API or other methods.

I considered collecting data (city, province) and then merging it, using the city as a common field, but I found that there are many countries so multiple cities .

2 REPLIES 2
lucadelicio
Super User
Super User

Hi @SoukainaELMIRI ,

i think this type of request change from different country.
Otherwise i think you need to download a complete dataset where this information is present in.
For example in Italy you can download the entire dataset of all the city of the country with its attribute like province.
Try to see on the internet if it is present a similar dataset with the infomation you are looking for.

Then you can import and do the merge to add this attribute to your actual dataset.

 I hope i'll help you.

 

Ciao



Luca D'Elicio

LinkedIn Profile

Thank you so much , so there is no automatic solution using bing map API.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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