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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi, I have two tables (Table 1-250 k records )and Table 2- (100 k records). Unfornutanly with no relationship. I would like to check if records from Table 1 is in 20 meters of proximity from each records of Table 2, and in case of calculate column with "yes".
I tried this solution, but could not make it work.
It is a pure GIS task, but is it any solution in powerbi? any feedbacks would be greatly appreciated.
Table 1.
ID | Latitude | Longitude |
255 | 35.19856 | -115.02153 |
320 | 29.935 | -90.10934 |
Table 2.
Lat | Long |
49.0430222 | 13.22595 |
49.04499 | 13.22858 |
Hi @leopoldvili_1 ,
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 .
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much @v-stephen-msft
I applied for your formula. howewer, I am getting a lot of 0. Where it should not be. Do you know what can be the reason?
Br,G
Hi @leopoldvili_1 ,
Sorry for my late reply.
Has your data directory been modified to the corresponding category?
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@goncalogeraldes thank you for your reply. But I would like to check distances for example id 255 from Table1- for each coordinates from Table2. and in case if distance is less than 20 m, write in column "Yes". after ID 320 and etc untill it goes to all records.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.