Last record

Hello, I am in need of displaying last record in a table field. I have depth field and second field with entries. I tried to count the number of depth fields and use it with recorditem function. When I used the recorditem function and manually writing the desired position then it works as intended. But when I replaced the manually written entry with the Count function of depth fields I got null. Is there any way to get it to work?

Thanks