Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
Trying to get distance between 2 points, either Zipcodes or Latitude/Logitude. Got the API key for Google Distance matrix API. Works fine when I manually try. But I have an Excel file in which I have columns with Zip codes for from and To and I want to iteratively go thru that list and get the distance and add in a new column. Either in excel or on Power Query.
For e,g, I tried below in a browser and got the distance.
https://maps.googleapis.com/maps/api/distancematrix/json
?destinations=22434
&origins=23173
&units=imperial
&key= XXXX
Anyone has any ideas ? A step by step guide will be very helpful.
Thanks in advance.
Ann
Solved! Go to Solution.
@pbi_user2024
Hi try the below.
=Json.Document(Web.Contents("https://maps.googleapis.com/maps/api/distancematrix/json?origins=" & Text.From([FromZip]) & "&destinations=" & Text.From([ToZip]) & "&units=imperial&key=YOUR_API_KEY"))[rows]{0}[elements]{0}[distance][text]
@pbi_user2024
Hi try the below.
=Json.Document(Web.Contents("https://maps.googleapis.com/maps/api/distancematrix/json?origins=" & Text.From([FromZip]) & "&destinations=" & Text.From([ToZip]) & "&units=imperial&key=YOUR_API_KEY"))[rows]{0}[elements]{0}[distance][text]
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.