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 so i am using RELATED. My code is:
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)))
Can someone spot where i have gone wrong? I'm getting the error "Function RELATED expects a fully qualified column reference as it's argument".
Solved! Go to Solution.
@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))
@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))
Hi @rogerdea ,
Found a related thread, see if any of the suggesstions is applicable in your case.
If not, please share your pbix file removing all the sensitive data, to try and replicate the issue.
Thanks
User | Count |
---|---|
136 | |
62 | |
57 | |
57 | |
46 |
User | Count |
---|---|
132 | |
62 | |
58 | |
56 | |
50 |