Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculate distance between Zip Codes?

I have a table with two fields as zip codes. An origination  zip code and a destination zip code. I would like to calculate the milage between the two zip codes. How would I do this?
  • v-xicai's avatar
    6 years ago

    Hi Anonymous ,

     

    The Latitude and Longitude are needed 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 may also achieve it via either Power Query or DAX method. Or you can use Google Map API .

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

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