Hello all,I have a question; I use the following excel formula to calculate the difference in KM between 2 lon lat points:
=IFERROR(ACOS(COS(RADIANS(90-E2)) *COS(RADIANS(90-I2)) +SIN(RADIANS(90-E2)) *SIN(RADIANS(90-I2)) *COS(RADIANS(F2-J2))) *6371;0)
(this formula is not mine but one I found on the internet) In the above formula note that:E2 = LatPoint1F2 = LngPoint1I2 = LatPoin2J2 = LngPoint1I was wondering if it is possible to convert this formula to a DAX query, since it would be convenient to be able to do this in Power BI.Thanks in advance,L.Meijdam
Go to Solution.
Distance = IFERROR(ACOS(COS(RADIANS(90-[Lat1]))*COS(RADIANS(90-[lat2]))+SIN(RADIANS(90-[Lat1]))*SIN(RADIANS(90-[lat2]))*COS(RADIANS([Lon1]-[Lon2])))*6371,0)
Okay this was alot more straightforward than I expected but it works indeed.
Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.
We spoke with Power BI Super User, Greg Deckler, about his charity work
Continue your learning in our online communities.