0
votes

I'm trying to calculate the burn rate for each trip of a vehicle in a PowerBi Report.

I have an entry for each time a vehicle has refueled which has the odometer reading. It also has liters fueled.

The calculation itself is simple. kilometersTravelled/Litres*100 = Burn Rate for that trip.

I want to get the kilometers for that trip by subtracting the previous odometer reading for the same vehicle (identified by Registration number). How can I do this?

I would like to have a column called KMsTravelled = (previous odometer) - (current) odometer.

From this, I can the do the burn rate calculation in a new column and then build the rest of the report from there.

Please point me in the right direction? Very new to DAX.

Sample of my Data:

Sample of Data

1

1 Answers

0
votes

in PBI you can create a new custom column.

Under home on the Ribbon - click edit Queries Under the add Column tab - click custom column

Its fairly simple from there, click on the columns you want to use e.g:

DAX requried