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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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