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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
kaym
Helper I
Helper I

Distance between 2 stops

Hello,

I have some logistics data where there are shipment number and for each shipment there are a number of stops. Typically, a shipment goes from stop 1 to stop 2. But for some shipments there are more than 2 stops i.e. stop 1,stop 2, stop 3, stop 4 etc.

I need to create a new column "distance" that shows the distance between stops in a shipment. I have no idea how to do it. I did create columns for latitiude and longitiude using google API. This is how my data looks:

kaym_0-1707850946073.png


The distance column should show the distance of a stop from the stop right above it for each shipment. Any help or guidance would be really appreciated. Thank you!

3 REPLIES 3
dufoq3
Community Champion
Community Champion

Hi @kaym,

 

this topic could help you or maybe directly @AlienSx.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

That's the Great Circle distance. It is meaningless for logistics.

lbendlin
Super User
Super User

I doubt that you want to calculate the Great Circle Distance ("as the crow flies").  There are no interfaces in Power BI to routing APIs.  You would have to calculate that elsewhere, taking into account local conditions (construction, road closures etc).

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.