Forum Discussion
Distance DAX
- 5 years ago
Are you looking for the distance of Every (all 50) points FROM the same Lat 43.72 and long -79.7 every time?
What was the first example Lat/Lon you used in testing to get 9.2 vs. 10.1? (Assuming I have 43.72 x -79.7 as the starting point)
FOrrest
I had to do this recently between zip codes in Excel. You have to convert Lat & Lon cordinates into Radiant values first, then you can use the formula in the 2nd screen shot. DAX has a RADIANS, SIN & COS calcuation just like Excel.
The hard part may be how to display this information? You'll need 2 sets of Lat & Lon to perform the calcuation, and I don't know how you plan to 'match up' two points to do so?
- Anonymous5 years agoNot applicable
Return
I have one set of Latitude and Longtitude only. Can you resend the 3rd screen short little bigger?
Thanks
- fhill5 years agoResident Rockstar
=IF(SIN(D2) * SIN(D3) + COS(D2) * COS(D3) * COS(F2 - F3) > 1,
3963.1 * ACOS(1), 3963.1 *
ACOS(SIN(D2) * SIN(D3) + COS(D2) * COS(D3) * COS(F2-F3)))- richbenmintz5 years agoResident Rockstar
Hi Anonymous ,
please see the blog post below, shout out to radacad,com
https://radacad.com/dynamic-distances-in-power-bi
Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!