Hello,
I assume, due to the used functions, that you are working in the modeling environment.
Following expression determines the last day of the previous month based on the current day.
Basically the first day of the current month is determined and than with function "adddays" minus one day is "added".
Best Regards,
Florian