Forum Discussion
Need help with lat/long coordinates
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.
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..
- v-xulin-mstf5 years ago
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,
Link
- Anonymous5 years agoNot 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?
- v-xulin-mstf5 years ago
Community Support
Hi Anonymous
Sorry, could you provide sample data without sensitive information?
Best Regards,
Link