Greg_Deckler
6 years agoCommunity Champion
Going the Distance
Uses the Haversine formula to compute the distance between the latitudes and longitudes of two points.
c =
VAR __FromCity = SELECTEDVALUE('From City'[City])
VAR __ToCity = SELECTE...
jaisveer21
3 years agoRegular Visitor
Greg_Deckler What do you mean by - c is the main measure and then you need to multiple this by the radius of the earth in either km, miles, etc.????
Isn't this the complete solution or there is something we have to multiply at the end after this whole piece of code?
Also for me, it shows '0' in the distance calculation.
Note- i have only 1 table having both to & from locations in the same table and I am using 'SELECTEDVALUE' intead of 'LOOKUP' for column reference still it gives me 0.
- Greg_Deckler3 years agoCommunity Champion
jaisveer21 Download the PBIX associated with this post and you will see how to use the measure. I made it generic so that you could use it for either miles or kilometers.