Forum Discussion

rogerdea's avatar
rogerdea
Helper IV
5 years ago
Solved

Distance calculation with RELATED

I've not been able to get my distance calculation working.  I'm following a solution on another post, but the only difference between this one and mine is that some of my coords are in another table ...
  • amitchandak's avatar
    5 years ago

    rogerdea , seem like a problem with ) , check one in bold

     

    Distance = ACOS(SIN('LB_Incident_Post1970'[Incident_Latitude])*
    SIN(RELATED('GIS.LifeboatStations'[Stn_Latitude])+
    COS('LB_Incident_Post1970'[Incident_Latitude])*
    COS(RELATED('GIS.LifeboatStations'[Stn_Latitude])*
    COS(RELATED('GIS.LifeboatStations'[Stn_Longitude]) - LB_Incident_Post1970[Incident_Longitude]))
    *6371))