distance calculation
2 TopicsHow to Find Nearest Elements to a Selected Item Using X and Y Coordinates in Power BI?
Hello everyone, I'm working on a Power BI report with data that includes X and Y coordinates for each item. I'd like to implement a feature that allows users to select an item and see a list or table displaying the closest items to it. I was able to calculate the distance of each item to a fixed coordinate in a column, but I couldn’t make that reference coordinate change based on the item selected in the slicer. Current Setup: A dataset with X and Y coordinates columns for each item. A data slicer that allows the selection of a specific item. Objective: Calculate the distance between the selected item and other items. Sort these items based on their proximity to the selected item. Display the nearest items in a table or other visualization in Power BI. Questions: Is it possible to achieve this directly in Power BI using DAX or any other built-in functionality? Is there an alternative approach to display the nearest items based on coordinates, perhaps using a map visual or a custom visual in Power BI? Thank you in advance for any suggestions or DAX examples you can provide!Solved1.2KViews0likes4CommentsHow to calculate distance of latitude and longitude using data in single file
I have a lat long file for the Indian geolocation. Want to calculate the distance between the geo-locations in the same territory. Data is available for Region, Branch, and territory. Where Region is the highest level of hierarchy and Territory is the lowest level of hierarchy. 1) I want to calculate the distance between each lat long in a territory. 2) Want to highlight data points in a 3 km radius from a selected lat-long. The sample data points: Region Branch Territory Dealer Code Latitude Logitude A aa aaa 002D000029 25.45145 81.87366 A bb bbb 002D000048 25.47273 81.85761 A cc ccc 002D000084 25.44915 81.7614 A dd ddd 002D000165 25.45609 81.87309 A aa abc 002D000192 25.45697 81.87075 A cc cde 002D000196 25.48831 81.8486 A cc efg 002D000222 25.46542 81.85095 A dd dfg 002D000295 25.52968 81.85361 B zz zzz 002D000298 25.46234 81.85505 B yy yyy 002D000308 25.49461 81.86021 B mm mmm 002D000318 25.62312 82.00485 B zz xyz 002D000541 25.46616 81.85084 B yy yzm 002D000649 25.45073 81.78039 B yy zyq 002D000666 25.45731 81.87041 B mm mpq 002D001070 25.45398 81.861414KViews0likes4Comments