Forum Discussion
PBI Maps based on Geo Coordinates
Hello everyone,
I require help in visualizing the content attached in the excel file and get meaningful insights.
I am working on a problem to recommend nearest Service Center based on distance from customer pincode to service center pincode.
In the attached file, I have Customer Pincode, Customer Latitude, Customer Longitude, ServiceCenter Pincode, ServiceCenter Latitude, ServiceCenter Longitude. Based on these details I have calculated Distance_Travelled_By_Customer. Typically most of the customers visit the nearest ServiceCenter that is available. However, I have noticed that they travel far to another ServiceCenter to get the service completed.
| Premium / Non-premium | Station Type | Customer_Region | Customer_State | Customer_City | Customer_Post_Code | Cust_Lat | Cust_Long | ServiceCenter_Region | ServiceCenter_State | ServiceCenter_City | ServiceCenter_Post_Code | ServiceCenter_Lat | ServiceCenter_Long | Distance_Travelled_By_Customer | Distance_Category | Recommended_ServiceCenter_Post_Code | Recommended_ServiceCenter_Lat | Recommended_ServiceCenter_Long | Distance_to_Recommended_ServiceCenter | Customer Visits |
| Non-Premium | Carry-in Center | North | Delhi | Parliament House | 110001 | 28.63 | 77.22 | North | New Delhi | Delhi | 110092 | 28.64 | 77.29 | 7.10 | 0-15 KM | 110024 | 28.57 | 77.24 | 0.07 | 2 |
| Non-Premium | Carry-in Center | North | Delhi | Darya Ganj | 110002 | 28.64 | 77.25 | North | New Delhi | Delhi | 110024 | 28.57 | 77.24 | 7.45 | 0-15 KM | 110092 | 28.64 | 77.29 | 0.05 | 1 |
| Non-Premium | Carry-in Center | North | Delhi | C G O Complex | 110003 | 28.59 | 77.23 | North | New Delhi | Delhi | 110024 | 28.57 | 77.24 | 2.76 | 0-15 KM | 110024 | 28.57 | 77.24 | 0.03 | 2 |
| Non-Premium | Carry-in Center | North | Delhi | New Delhi | 110005 | 28.66 | 77.19 | North | New Delhi | Delhi | 110085 | 28.72 | 77.11 | 10.14 | 0-15 KM | 110085 | 28.72 | 77.11 | 0.10 | 4 |
| Non-Premium | Carry-in Center | North | Delhi | New Delhi | 110005 | 28.66 | 77.19 | North | New Delhi | Delhi | 110092 | 28.64 | 77.29 | 10.45 | 0-15 KM | 110085 | 28.72 | 77.11 | 0.10 | 1 |
| Non-Premium | Carry-in Center | North | Delhi | New Delhi | 110006 | 28.66 | 77.23 | North | New Delhi | Delhi | 110092 | 28.64 | 77.29 | 6.27 | 0-15 KM | 110092 | 28.64 | 77.29 | 0.06 | 3 |
| Non-Premium | Carry-in Center | North | Delhi | New Delhi | 110007 | 28.68 | 77.19 | North | New Delhi | Delhi | 110024 | 28.57 | 77.24 | 13.19 | 0-15 KM | 110085 | 28.72 | 77.11 | 0.09 | 2 |
| Non-Premium | Carry-in Center | North | Delhi | New Delhi | 110007 | 28.68 | 77.19 | North | New Delhi | Delhi | 110085 | 28.72 | 77.11 | 9.05 | 0-15 KM | 110085 | 28.72 | 77.11 | 0.09 | 1 |
| Non-Premium | Carry-in Center | North | Delhi | New Delhi | 110007 | 28.68 | 77.19 | North | New Delhi | Delhi | 110092 | 28.64 | 77.29 | 10.89 | 0-15 KM | 110085 | 28.72 | 77.11 | 0.09 | 2 |
I would do something like this:
A user selects its location which is point A and the distance is calculated from point A to several Point B's. The user selects the maximum radius. The shortest is what you'll likelly recommend to the user but you can show other locations as an option.
https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/Philippine-Barangays-on-the-Map/m-p/3384116Here's the tutorial https://www.youtube.com/watch?v=5nkPRsD-olM
3 Replies
- danextian
Super User
Hi prasadhebbar315
The only thing I can think of is to use the Haversine formula to calculate the shortest distance between two points but this doesn't take into account that going from points A to B isn't always a straight line. You can ask ChatGPT to give you the formula in DAX. If you want the actual distance, you'll need to use the Distance Matrix API from Google or similar ones - https://developers.google.com/maps/documentation/distance-matrix/overview - prasadhebbar315
Advocate I
danextian I have already calculated the haversine distance by fetching Latitude and Longitude from Google API and they are accurate. I am looking at possibilities to visualize the data in Power BI. How do I show recommendations to customers?
- danextian
Super User
I would do something like this:
A user selects its location which is point A and the distance is calculated from point A to several Point B's. The user selects the maximum radius. The shortest is what you'll likelly recommend to the user but you can show other locations as an option.
https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/Philippine-Barangays-on-the-Map/m-p/3384116Here's the tutorial https://www.youtube.com/watch?v=5nkPRsD-olM