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
Anonymous
Not applicable

Need help with lat/long coordinates

Hi!

 

I am hoping you can assist me with an issue I am having. 

 

I want to be able to get a number value, such as distance, using longitude and latitude values. So I want to gain insight on driving distance, using calculations based on longitude and latitude. Therefore, I am looking to create an expression that gives me a numeric value (such as distance for example), based on comparing how far the driving distance between two points represented by lat & long are. 

 

Hope this makes sense! I basically want to see driving distance using values from longitude and latitude. 

 

Really hoping you can assist me with this

6 REPLIES 6
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

You need Latitude and Longitude to calculate the distance between two locations with following formula:

 

=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1))*6371

 

ps: 6371 is Earth radius in km.

 

You can refer:

https://radacad.com/dynamic-distances-in-power-bi

http://www.girlswithpowertools.com/2014/05/distance/

 

Best Regards,

Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi and thank you for your answer,

 

How can I determine lat1 and lat2 values? The lat values are all in the same column, and Power BI does not allow for chooing individual cells. So how does power bi know which exact values (such as lat1) to work with? So I do not just the whole column..

Hi @Anonymous,

 

The two coordinates to be calculated need to be in two different columns in order to facilitate the calculation of the distance between the coordinates.

 

Best Regards,

Link

Anonymous
Not applicable

I see, however my column with latitude and column with longitude are 10,455.. so I would have to have separate columns for all of these values?

Hi @Anonymous

 

Sorry, could you provide sample data without sensitive information?

 

Best Regards,

Link

Pragati11
Super User
Super User

Hi @Anonymous ,

 

You can look into the ArcGIS Map visual which helps in calculating driving distances and driving times. 

Do refer the following documentation on this:

https://doc.arcgis.com/en/power-bi/design/find-nearby-locations.htm

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.