# Using M value to calculate duration seems to cause some issues

**URL:** <https://community.qfield.org/t/using-m-value-to-calculate-duration-seems-to-cause-some-issues/1513>\
**Category:** Advanced Use & Customization\
**Created:** [5 March 2026 16:30 UTC](https://community.qfield.org/t/using-m-value-to-calculate-duration-seems-to-cause-some-issues/1513 "2026-03-05T16:30:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen-GroeneBij](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/jeroen-groenebij/32/905_2.png) [@Jeroen-GroeneBij](https://community.qfield.org/u/Jeroen-GroeneBij)\
**Post date:** [5 March 2026 16:30 UTC](https://community.qfield.org/t/using-m-value-to-calculate-duration-seems-to-cause-some-issues/1513/1 "2026-03-05T16:30:13Z")

</div>

Hi, I have no idea if this turns out to be a bug or something else.  
I am trying to get a duration for tracked routes using the following:  
I have a geopackage with a Linestring layer and I have Include M values ticked when creating the layer.  
In this layer the line objects from Tracking are stored.  
One of the fields (integer type) is called duration.  
I would like to populate this field with the duration of the track, so I use the expression

```auto
m(end_point(@geometry))

```

This will return the m value of the last vertex and with the default QField tracking setting for m values (elapsed time), this gives me the duration.

Now, when I use this expression in the Attributes Form as Default value (with or without checking the Apply default on update box), QField is having problems with the internal positioning in such a way that it thinks my position is at random times suddenly more than 50 meters away and jumping back.

When I remove the default setting in the Attributes form, QField seems to be okay. I notice no weird behaviour. M values are being stored, so I can add duration afterwards in QGIS.

Could it be that the expression using end\_point(@geometry) has an issue with tracking where end\_point might no be clear all the time?  
This is on a google pixel 8 phone and QField 4.0.5
