cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
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:

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

Best Regards,

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

Anonymous
Not applicable

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..

Community Support

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,

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?

Community Support

Hi @Anonymous

Sorry, could you provide sample data without sensitive information?

Best Regards,

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

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

Proud to be a Super User!!