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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jacques_412
Frequent Visitor

Finding the latitude and longitude of addresses

Hi all

 

I am trying to get the distance from each employees home address to their place of work. For home address, it is broken into 6 columns, including post code, street address, town/city etc. The work address is simply a single column name of work location.

 

I am trying to use bing to calculate the latitude and longitude of each address for each person. Thus, I will have a a column for latitude and longitude for home address and work address, and use another method to calculate the distance. I have tried adding a column in power query with the following:

 

    = Table.AddColumn(#"Inserted Merged Column", "Custom", each Json.Document(Web.Content(http://dev.virtualearth.net/REST/v1/Locations?query= & countryRegion="UK"&PostalCode=Text.from([Addressline6]) & locality=Text.From([Addressline4]) & maxResults=1 &key="AuM2IVexzTdbn5uZ8LR1ruMqCle3e0RO6yfghggfhghnewz5hyCmrM_QZAIYW2eU")))[resourceSets]{0}[resources]{0}[point][coordinates]{0}

 

I get the error: The name 'web.content isn't recognized. Note that I put in a fake key above.

 

Any idea where I am going wrong?

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @jacques_412 ,

 

The function is Web.Contents(...).

 

https://learn.microsoft.com/en-us/powerquery-m/web-contents 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

1 REPLY 1
BA_Pete
Super User
Super User

Hi @jacques_412 ,

 

The function is Web.Contents(...).

 

https://learn.microsoft.com/en-us/powerquery-m/web-contents 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors