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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Finding Distance Between 2 zip codes Using Google Maps API

Dear Power BI community, 

 

I am working on a task where end users can key in 2 zip codes to get the distance in miles in Power BI. I have got myself a Google Maps API key, but below are the 2 problems that I ran into:

 

1) I am trying to create a report where the end users can key in two 5 digit zip codes themselves, and the only way that I can think is to create a new parameter. However, the parameter will not let me create numbers in the increment of 1 from 0 to 99999. Does any of you know any other way to create a textbox/interactive visualization so that the end users can key in numbers themselves?

 

2) I was looking at different blog posts/ Youtube videos to see how to utilize the Google Maps API key in Power BI to find the distance between 2 points, and from what I have learned from them is that I need to create a function (let's call it Google Maps API Function) that connects to Google Maps, and then on the actual dataset (which contains an origin and destination zip code), I will create a new column to invoke the custom function (Google Maps API Function) I created. 

Is there a way to make it work that the users can key in 2 zip codes, and then after keying in the 2 zip codes, the Google Maps API Function will then be triggered to run and return me with the distance? 

The reason I am asking this is because I have no idea/no control over which zip codes the users are going to key in beforehand. 

Also, it seems like I am not able to create a new column to invoke the custom Google Maps API function on the parameter I created for users to key in zip codes. Does anyone know a way around this? 

 

Thank you so much. Any advice/suggestion will be greatly appreciated. 

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at this post and research the Advanced Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.