Forum Discussion
Distance Calculation in Power BI
- 9 years ago
do you have LAT and LONG? If yes you can do it with math:
if not you need to custom call Bing Maps or Google Maps APIs for that
- 9 years ago
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 achieve it via either Power Query or DAX method.
Or you can use Google Map API as cs_skit suggested.
Regards,
- 9 years ago
I did a blog post on calculating the direct line distance between two points in DAX
do you have LAT and LONG? If yes you can do it with math:
if not you need to custom call Bing Maps or Google Maps APIs for that
How do I use Google Maps API in Power BI?
- Phil_Seamark9 years agoMicrosoft Employee
I did a blog post on calculating the direct line distance between two points in DAX
- ShrikantKhanna8 years agoHelper II
This post is great but can anyone assist in calculating distance between two postcodes ?
- GuySev7 years agoAdvocate I
Fantastic blog, worked great for me
- MAAbdullah477 years agoHelper V
Thank you for this post, If I want to use ArcGIS map and I pointed on a City then I want to determine the nearest cities within (x) kilometers radius how can we do this?
- Anonymous7 years agoNot applicable
Hello,
Did you get any answers? I have similar problem :)
Thanks.