Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi!
I am hoping you can assist me with an issue I am having.
I want to be able to get a number value, such as distance, using longitude and latitude values. So I want to gain insight on driving distance, using calculations based on longitude and latitude. Therefore, I am looking to create an expression that gives me a numeric value (such as distance for example), based on comparing how far the driving distance between two points represented by lat & long are.
Hope this makes sense! I basically want to see driving distance using values from longitude and latitude.
Really hoping you can assist me with this
Hi @Anonymous,
You need Latitude and Longitude to calculate the distance between two locations with following formula:
=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1))*6371
ps: 6371 is Earth radius in km.
You can refer:
https://radacad.com/dynamic-distances-in-power-bi
http://www.girlswithpowertools.com/2014/05/distance/
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi and thank you for your answer,
How can I determine lat1 and lat2 values? The lat values are all in the same column, and Power BI does not allow for chooing individual cells. So how does power bi know which exact values (such as lat1) to work with? So I do not just the whole column..
Hi @Anonymous,
The two coordinates to be calculated need to be in two different columns in order to facilitate the calculation of the distance between the coordinates.
Best Regards,
Link
I see, however my column with latitude and column with longitude are 10,455.. so I would have to have separate columns for all of these values?
Hi @Anonymous
Sorry, could you provide sample data without sensitive information?
Best Regards,
Link
Hi @Anonymous ,
You can look into the ArcGIS Map visual which helps in calculating driving distances and driving times.
Do refer the following documentation on this:
https://doc.arcgis.com/en/power-bi/design/find-nearby-locations.htm
Thanks,
Pragati
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |