You say "I want to get one value from one table based on a filter from another table (or take last value in the column (sorted by date))." Your statement is about as clear as mud.
Sorry. With this level of detail, I can't do much even if I wanted 😞
For instance, do you really want to get one value from some column when there is a filter on a different table? What if there are many values that the filter makes visible? Do you then want the MAX, the MIN of the values? You also say "take last value in the column." That would point to some kind of MAX or MIN... but then sorted by date - descending? Ascending? There are many more questions... but let's stop here.
When you ask questions, it would really be good---and you'll do yourself a big favor---if you could be precise. Otherwise, you risk not getting any answers because people should not have to decipher and make guesses about what it is you wanted to do... They should know exactly what you want(ed) to do.