Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have two tables in Power BI desktop called 'Centers' and 'Stores'. The 'Centers' table contains only my shopping center locations and has the columns: [CenterID], [CenterLatitude], and [CenterLongitude]. The 'Stores' table contains store locations and has the columns: [StoreID], [StoreLatitude], [StoreLongitude], and [CenterID]. The 'Centers' table has a one-to-many relationship with the 'Stores' table. Some of the stores in the 'Stores' table are located within my shopping center and will have a matching value in the [CenterID] column. The stores that have a null value in the [CenterID] column are not within my shopping centers. I want to be able to select a shopping center location and show all of the store locations that are within X miles or less of my shopping center location including my stores. How can I do this?
hi @JoeMar ,
you can calculate the perpendicular distance between two points, mentioned in the post below:
Solved: Distance Calculation in Power BI - Microsoft Fabric Community
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.
Or you can use Google Map API as @cs_skit suggested.
i think you could filter by this distance column to get stores in proximity ( after selecting a point)
User | Count |
---|---|
14 | |
10 | |
7 | |
6 | |
5 |
User | Count |
---|---|
30 | |
19 | |
12 | |
7 | |
5 |