ANY(Select... always returning the first record it finds

I have an App with 3 Tables (Vehicles, Staff and Allocated) which track who is allocated to a particular vehicle.

So from the Vehicles table, I can use this formula
ANY(Select([Related Allocateds][Allocated To],ISBLANK([Returned to])))
to get the ID record from the Allocated table of the last record the vehicle was allocated but not returned. This works fine. When I show it in a table I can see lots of different ID numbers against each vehicle. As expected.

But when I add this encapsulation to pull in the users name from the Staff table
ANY(Select(Staff[Name],[StaffID]=
ANY(Select([Related Allocateds][Allocated To],ISBLANK([Returned to])))
))
it always pulls in the first record if finds in Staff[Name]. Itโ€™s almost like its ignoring the equals sign

Any ideas?

0 2 124
2 REPLIES 2

3X_d_0_d0e0f3c67058840ae8a6d12ec0441886ebab472c.png

Steve
Platinum 4
Platinum 4

Try this instead:

ANY(
  Select(
    Staff[Name],
    ANY(
      Select(
        [Related Allocateds][Allocated To],
        ISBLANK([Returned to])
      )
    )
    = [StaffID]
  )
)
Top Labels in this Space