0

I've looked at similar google and SO questions, but I couldn't figure out how to translate those answers into my current problem. Using Power BI, I'm trying to figure out how the distance in miles between 2 locations.

The information will be displayed on a card, and the user will use a drop down box to choose a city. This assumes that 1 location is always the same, which I have made a separate table specifically for this. Here is an example of my data set (over 30k rows): Here is an example of my data set (over 30k rows) This is the simple table I made with the default location:

This is the simple table I made with the default location

I'm not certain where to go from here. I'm thinking I need 2 power BI measurements: 1 for the Haversine formula I think it is, 1 for the default location? I'm really new to DAX so would appreciate help with this, thank you!

EDIT: a poster deleted their comment too quickly, but I tried to alter some of the code that was posted. Its kind of working, I'm just trying to figure out how to correctly convert it from KM into Miles. enter image description here

Synik
  • 139
  • 1
  • 12

1 Answers1

0

For anyone else wondering how to do it: See the image in my OP. Change "kaggle_income" to the first lat/long table and "Scottsdale" to the 2nd lat/long table.

As for miles, the numbers seem off, but 12734 in the original image is the diameter of Earth, in miles its 7917, which again, is still showing off in Google maps, but who knows, close enough for me.

Synik
  • 139
  • 1
  • 12