Previous data autofill

I need some help.
A “Túra indítás” page is given, including “Tankolások” with uid REF. (see: picture)
My question,
I would need the “Előző tankolási km”" within the Ref UID!
So, automatically fill it with the previous data OnLY assigned to ref UID data. For each new “Túra indítás”, only monitor the data within it (UID).

Furthermore, in “Túra indítás” I would like to automatically calculate the “Összesen megtett km” based on “Tankolások” - “Megtett km”.

I really hope that I was able to describe it in such a way that it is understandable what I want :)))

Thank you very much for your kind help,

Hi @Betti ,

I think that what you want is a formula for a mileage (or kilometrage) in a field that, whenever you fill a tank of a vehicle id, automatically provides the last mileage of that vehicle.

I would do this in an additional Virtual Column (could be called “last mileage”)

Later, you will fill another column with the difference between the mileage that the vehicle has when refuelling and this “[last mileage]”

I am not sure of:

  • whether you keep track of the vehicle ID in UID or in Tankolas UID.
    • What does Túra Indítás stand for? Start of journey? (I did not got that…)
  • Km állás is the kilometrage when you fill the vehicle’s tank?

If I got your problem right the formula would be something like this:

I am converting this to English since my Hungarian is null:

ANY(
   SELECT([Mileage],
          [ID] = MAXROW("TankLoads",
                        "Date",
                         AND([Vehicle] = [_THISROW].[Vehicle],
                             [Date] < [_THISROW].[Date])
                       )
           )
    )

Please note:

  • [ID] would be the RowID whereas Vehicle would be VehicleID
  • I assumed Tankolasok means TankLoads , Date is Datum

Formula Explanation:

MAXROW(“TankLoads”, “Date”, AND ([Vehicle] = [_THISROW].[Vehicle], [Date] < [_THISROW].[Date])):

Gets the ID of the record with the most recent date (Date) for the same vehicle (Vehicle) but that is before the date of the current load.

SELECT(TankLoads[Mileage], [ID] = …):

Selects the mileage from the record identified in the previous step.

ANY(…):

Since SELECT returns a list, ANY takes the first (and only) value from that list, which is the mileage of the previous load.

2.14.0.0
2.14.0.0
2.14.0.0

translation of the words:

  • UID Ref in Refueling table - it refers to the unique identifier of the Road Start
  • Utolsó tankolási km mean - Last refueling km
  • Km állás mean - Mileage
  • Túra indítás mean - Road Start
  • Rendszám mean - License plate number
  • Tankolás UID (UNIQUEID) mean - Refueling UID,this is the unique identifier of the rows

ooo, looks like this has become a difficult task.
So, I have a formula that shows the last data from the “refuelings” table, but it only inserts the last data from “Refuelings” and doesn’t listen to the “Road Start” UID that the “Refuelings” data refers to.
I would like the filtering to filter the last “Refueling km” data based on the “Road Start” UID.

@pbalerio do you have any info? I still haven’t solved it :disappointed_face: