Forum Discussion
power bi distance map US
hi, I would like to create a map to track distance between cities in the Us, I'm out of clue . If you could please tell me how to or tell me where to find a templeate please, I appreciate your help
Hi, madiehc25
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 achieve it via either Power Query or DAX method.
For reference:Dynamic distances in Power BI - RADACAD
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-zhangti
Community Support
Hi, madiehc25
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 achieve it via either Power Query or DAX method.
For reference:Dynamic distances in Power BI - RADACAD
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.