Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
some1else
Helper II
Helper II

Calculating distance between list of coordinates

I wonder if it's possible to calculate each row value distance compared to other rows in a column.

 

An example:

 

Untitled.jpg

 

I know the method to create this in Excel, but I was hoping for some insight into recreating this in PBI, since Excel is limited to 16k columns

 

The objective is to count the number of ocorrences, given an max distance. Like an heatmap but with numbers 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @some1else ,

 

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

 

 

Reference:

Distance Calculation in Power BI
How to calculate lat/long distance

 

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @some1else ,

 

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

 

 

Reference:

Distance Calculation in Power BI
How to calculate lat/long distance

 

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.

Anonymous
Not applicable

Calculate all the distances in Power Query, then import the table into Power BI. The table can be of the form:

 

Left Point | Right Point | Distance

------------------------------------

 

From this it'll be dead easy to create what you want.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.