Forum Discussion
Calculating (adding) distance between multiple locations using longitude and latitude
- 5 years ago
Hi Anonymous ,
You could use 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
Then sum up the distances by each person and divide 3 to get the result you need.
ps: 6371 is Earth radius in km.
You can achieve it via either Power Query or DAX method.
Or you can use Google Map API .
You could also check the reference below:
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Anonymous , is your formula not giving the correct result?
refer if needed
http://www.girlswithpowertools.com/2014/05/distance/
https://dhexcel1.wordpress.com/2015/08/16/measuring-distance-in-power-bi-desktop/
- Anonymous5 years agoNot applicable
Morning Amit,
Thanks for your reply.
The formula in my post does not give the right answer. I will look at your links now and update you.