Route Analysis in Power BI: From Data to Animation in Logistics

The best way to visualise routes in Power BI is to use the Azure Maps Path layer with properly prepared Path ID and Point Order fields. Every point on a route needs a latitude and longitude, and for animation it also needs a timestamp. Below we give a Power Query Unpivot example and some guidance on time-based animation.


In brief:

  • In Power Query, unpivot the start and end coordinates into rows, use an index to create a route ID, and assign order numbers 1 and 2 to the two ends.
  • Sort the points by time so that each route’s sequence is consistent, with no gaps or duplicates, and the line does not jump across the map.
  • If coordinates are stored as integers, check their scale and divide by 1,000,000 if necessary, and make sure latitude and longitude have not been swapped.
  • For animation, convert the timestamp to a date/time type, relate a time table to the route data table and set one position per interval.
  • Test a single route first and only expand the dataset once you have checked its geometry, because animation does not fix an incorrect point sequence or wrong coordinates.

Contents

Where the Path layer beats other map visuals

Power BI offers several mapping options, and they are clearly described in the map visualisations overview. The main ones are:

  • The Azure Maps visual includes bubble, 3D bar, heat map, filled area, marker, Path and reference layers.
  • The filled (shape/fill) map can work well for comparing regions, whereas the Path layer is designed for visualising routes.
  • The ArcGIS visual can be useful for more complex spatial analysis; to visualise a route sequence, choose the Path layer.

Simple markers show where a vehicle was, but not how it moved. The Path layer joins points into a continuous line, which makes it suited to vehicle, ship and flight trajectories, as well as supply network analysis. When you need both the route and the stops, combine Path with a marker layer: the line shows the journey and the markers show loading or unloading points.

How to prepare the data: Path ID, Point Order, coordinates and time

The Path layer only works when each row is a single point on a route. You need four fields: Path ID (which route), Point Order (which point in the sequence), latitude and longitude, and, if you want animation, a timestamp.

  1. Load the data and check the coordinate data type. If the coordinates are stored as integers, check their scale and apply the appropriate conversion if needed, as described in this data cleaning lecture.
  2. If you have origin–destination rows (two ends in one row), select both coordinate columns in Power Query and click “Unpivot Columns”. You will get two rows for each route: the start and the end.
  3. Before unpivoting, add an index column (“Add Index Column”) and use it as the Path ID, so that every route has a unique identifier.
  4. Build Point Order from the attribute column after the Unpivot: assign 1 to the start and 2 to the end. For intermediate points, use the order of the timestamps.
  5. Check that, for each Path ID, the Point Order sequence has no gaps or duplicates and that time increases along with the sequence.

Pro tip: Sort by Path ID and time before loading the data into the model. You will spot a broken sequence straight away, rather than only as an oddly jumping line on the map.

If you need to pull data from company systems, our article on the Power BI data gateway will come in handy.

How to configure the Azure Maps Path layer in a report

Add the Azure Maps visual and switch on the Path layer. The official documentation requires a unique Path ID and a Point Order field, because the visual uses them to group points into lines and determine their sequence. The Power BI team introduced this layer alongside data-bound reference layers and geocoding.

Configuration steps:

  • Assign latitude and longitude to the corresponding fields, put the Path ID in the Path ID field and Point Order in the ordering field.
  • In the Legend field, use the route type or vehicle so that lines are shown in different colours.
  • Use conditional formatting to colour by delay or distance, if that value has already been calculated in the model.
  • In tooltips, show the driver, order number and time, but not every column, as an overloaded tooltip gets in the way.
  • Hover and select work together with other visuals: select a route in a table and the line is highlighted on the map.

What to avoid: do not mix too many layers in one visual, and do not expect every feature to work alongside Path ID. We cover the limitations below.

How to add a time dimension and animate routes

Animation needs a time column that Power BI treats as a date and time rather than text. Convert it in Power Query and create a separate time table related to the route facts.

  • Choose an interval to suit your needs, for example a shorter one for data from a single vehicle and a longer one for the whole fleet.
  • Aggregate points into intervals so that each time step has one position per route.
  • Link the Play axis or time slicer to the time table, not to the raw column.
  • Start with one day’s or one week’s data and expand only once you have checked that the animation runs smoothly.

For logistics data, a short interval and a single-day slice may be enough, but the right choice depends on your data and analysis needs.

Pro tip: Reduce the number of points before the model, not in the visual. Removing the repeated points recorded while a vehicle is stationary often speeds up the report without harming the shape of the route.

Common mistakes and Path layer limitations

The biggest problem is usually the data, not the visual. The most common cases:

  • Jumbled Point Order sequence: the line jumps across the map. Sort by time and renumber the points.
  • Incorrect coordinates: points end up in the ocean or in Africa. Check that you have not forgotten to divide by 1,000,000, and that latitude and longitude have not been swapped.
  • Layer incompatibility: when Path ID is used, some features of other layers are switched off, so test complex combinations early.
  • Slow report: reduce the number of points with filters and interval aggregation.
  • Quick test: check a single Path ID. If it is drawn correctly, look for the problem in the other routes.

Quick checklist from import to publishing

  1. Import the route and GPS data and check the column types.
  2. Clean the coordinates, removing duplicates and blank rows.
  3. Run the Unpivot and add an index to build the Path ID, then set Point Order according to the point sequence.
  4. Create a time table and relate it to the fact table.
  5. Configure the Azure Maps Path layer, colours and tooltips.
  6. Test with a single route, then with the full dataset.
  7. Check access permissions before publishing. If you use Publish to web, remember that this makes the report public to anyone with the link.

We discuss modelling questions in more detail in our article on when a business needs a Power BI data warehouse.

When a professional implementation saves time

We offer ready-built Power BI packages and bespoke projects in which we automate data integration and refreshes, so you do not have to repeat them by hand. This is particularly useful when the transformations are complex or the data needs to be combined with Rivilė or Finvalda systems.

Editor’s view: start with the data, not the map

Editor's view: start with the data, not the map — overview diagram

Most beginners go looking for the most attractive visual first, then get stuck on the data. In our view, the Path layer can work more smoothly with tidy data, while a messy sequence can produce an unexpected-looking line. So the first investment should not be colours or animation, but a clean Point Order sequence and correct coordinates.

The common advice to draw everything and fix the errors afterwards does not pay off: an incorrect line is harder to spot on a map than in a table. First get one route right from start to finish, make sure the sequence is correct, and only then expand to the whole fleet. Add animation only once you have checked the core solution, because it does not fix data problems.

— Analitika360

We can help you implement route analysis on your data

Analitika360

We offer ready-built Power BI report packages and bespoke projects tailored to your processes and existing systems. Get in touch for a quote; you will find prices and package contents on our pricing page.

Frequently asked questions

Which visual do I need to show routes in Power BI?

To show routes, use the Azure Maps visual with the Path layer switched on. It needs Path ID, Point Order and coordinate fields.

Is a time column required for animation?

Yes, animation needs a time field that Power BI recognises as a date and time. Without it, the map shows only a static route and movement over time cannot be recreated.

Why does my route line jump across the map?

The usual culprit is an incorrect Point Order or swapped coordinates. Sort the points by time, renumber them and check whether the coordinates are stored as integers.

How do I prepare origin–destination data?

In Power Query, unpivot both coordinate columns so that one row becomes two points. Build a unique Path ID from an index column, and assign an order to the start and end.

Sources

Further reading

Want reports like these for your own business?

Analitika360 builds Power BI reports from the data already in your accounting system — Rivilė, Finvalda or R-Keeper. They refresh automatically, from €59 a month.

Pricing and plans
Analitika360 client stories

Data that helps you decide

See how companies like yours put Analitika360 reports to work in Power BI.

“
We took the standard R-Keeper report package and they tailored it to us on top of that. It all just works.
TB
Tomas B.restaurant owner
“
Twenty ready-made reports — we didn't have to work out what to ask for. Our Finvalda data is finally something you can look at. Recommended.
IM
Ingrida M.accountant
“
What we liked was that Analitika360 already had a 20-report package for Rivilė users — we didn't have to work out our requirements from scratch. We were up and running quickly, and later they adapted several reports to the specifics of our production. It saved us both time and money.
MK
Marius K.finance director
“
We are a group of companies running Rivilė, and consolidated reporting was always a headache. Analitika360 started from the standard 20-report package and then fitted it to our group structure — we now see everything in one Power BI model, and it refreshes itself.
GJ
Giedrė Jankauskaitėfinancial accountant
“
We run six restaurants on R-Keeper and had long been looking for a way to compare results across sites. The standard 20-report package covered most of what we needed, and reports specific to our group were added later.
AŠ
Andrius Š.director of a restaurant group
“
We came to them on a recommendation, and the ready-made 20-report standard for Finvalda users was a pleasant surprise straight away. Management now gets a clear financial picture every Monday, and I no longer spend days exporting data into Excel.
RP
Rasa Petrauskienėhead of accounting
“
We use Rivilė, but we never had time to build reports from scratch. The 20-report package was exactly what we needed — we had it running within a week.
VP
Vaidas P.retail chain manager
“
We have four cafés on R-Keeper and for a long time we ran them on gut feel. The Analitika360 reports showed us things we had simply never noticed. We now decide on the numbers rather than on guesswork.
LK
Laura Kazlauskienėfinance director of a café group