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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
danialsj
Frequent Visitor

Calculate largest distance between two coordinates

I have a dataset with two competing bank branches mapped on latitude and longitude. I want to determine which branches are the furthest from a competitor branch. 

 

So far I have figured out how to calculate the distance between two coordinates. Now I want to create a top 50 list of branches that are furthest away from any other branch. 

 

My mind is fried trying to find a way. Can anyone help?

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

To be able to do such things in a reasonable time you have to pre-calculate the distances between any pair of branches and store this into a physical table in the model. Best would be to calculate this in Power Query or in an outside source system (like, say, SQL). Depending on the amount of data, it may not be feasible to do it in DAX as a calculated table. Once you have such a table, it's then dead easy to find what you want.

View solution in original post

Anonymous
Not applicable

@danialsj 

If you can get the long and lat into tables, then you may able to calculate the distance and compare.

Solved: Calculating Distance Between Latitude / Longitude - Microsoft Power BI Community

Use Power Query to Calculate Distance – Girls With Power Tools

 

 

Paul Zheng _ Community Support Team
If this post helps, please 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

@danialsj 

If you can get the long and lat into tables, then you may able to calculate the distance and compare.

Solved: Calculating Distance Between Latitude / Longitude - Microsoft Power BI Community

Use Power Query to Calculate Distance – Girls With Power Tools

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

To be able to do such things in a reasonable time you have to pre-calculate the distances between any pair of branches and store this into a physical table in the model. Best would be to calculate this in Power Query or in an outside source system (like, say, SQL). Depending on the amount of data, it may not be feasible to do it in DAX as a calculated table. Once you have such a table, it's then dead easy to find what you want.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.