Last day of the month


I need to find the last day of the preceding month of the last refresh of the data model.
No better idea than this:
it is more or less ok, if there is like a daily refresh, but 100% good.

Do we have a better formula to find the last day of the previous month?
Can we access last refresh date with a variable from the backend, not from the menu, the latter cannot be built in a calculation?

Thank you