Calculating Distance between two sets of geographic coordinates using only zip codes or cities

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • This video used Excel data type Geography and Power Query to find the difference between 2 sets of coordinates. Using only zip codes, you can extract Lat and Long using Excel data types; these tables are then loaded into a power query to find the distance between points.
    Power Query M Formula for Distance in Miles (Replace all the Bold with your column names):
    Number.Acos(Number.Cos((90-[Latitude])*Number.PI/180)*Number.Cos((90-[Leads.Latitude])*Number.PI/180)
    + Number.Sin((90-[Latitude])*Number.PI/180)*Number.Sin((90-[Leads.Latitude])*Number.PI/180)*Number.Cos(([Longitude]-[Leads.Longitude])*Number.PI/180)) * 3959

Комментарии • 12

  • @ziggle314
    @ziggle314 5 месяцев назад +1

    Nice job. I like seeing a good application for the geographic data type. Thanks!

  • @naturelover7998
    @naturelover7998 5 месяцев назад +1

    Finally found the solution, thank you so much for video. great Job...

    • @excel4urparents242
      @excel4urparents242  5 месяцев назад

      I’m so glad you found this useful, and it was able to help.

  • @hspgutub
    @hspgutub 2 месяца назад

    Great explanation. Thank you!!!

  • @patrickdowe208
    @patrickdowe208 4 месяца назад

    This is brilliant. Thank you. What if I'm trying to get clusters of the lead addresses, i.e., grouping addresses that are close to each other.

  • @kebincui
    @kebincui 5 месяцев назад

    Excellent 👍 🌹

  • @lorismetro7729
    @lorismetro7729 8 месяцев назад

    I don't understand what is "lead" and why you created other columns labeled with "lead". By the way this is a great video. Thank you.

    • @excel4urparents242
      @excel4urparents242  8 месяцев назад

      Hi @lorismetro7729 I'm glad you enjoyed the video! A lead is a sales term meaning a potential customer or prospect who has expressed interest in a product or service. I know there are many different uses for distance calculations, I come from a sales analytics background, so I put it in this context. Thank you for mentioning it, I will try and use more generic terms in the future!

  • @user-rg8vi7ct2r
    @user-rg8vi7ct2r 6 месяцев назад

    Hi, is a car dirving distance? or is a air line distance between two points?

    • @excel4urparents242
      @excel4urparents242  6 месяцев назад

      Hi! This is a direct line distance between two points.

  • @user-fy1ng5xd5i
    @user-fy1ng5xd5i 6 месяцев назад

    Can we deliver this using sql server only?