cancel
Showing results for
Did you mean:

## Get Last Day of a Month

We need a function to get in a simple way the last day of a month.

Today I do this by using below functions and works, but is so complex:

A function like startOfMonth would be amazing.

Regards,

Gustavo Moraes

Status: Under Review

This is a great idea, thank you!  Power Automate
Status changed to: Under Review

This is a great idea, thank you!  Microsoft

+1

We have a use case for this to present to our customers.

When can we expect this change to rollout? New Member

There is now a startOfMonth function. To get the last day of the current month, you can simply use:

`subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day')`

This adds a month to the current day, jumps to the first day of the next month, then subtracts a day to be at the last day of the current month.  Big thanks to @leep

The formula you posted is exactly what I needed to calculate the end of the month.  Thank you!!!  😊 Regular Visitor

I'm a little confused by the need for a specific function for this.  I was able to determine if today is the last day of the month with the following:

If(Month(Today()) = Month(Today()+1), "Not Last Day Of Month""Last Day Of Month")
{In other words - If I add one day to today and it's still the same month, then this is not the last day of the month.  Otherwise, it is.}

Combined with the above determination I am able to identify the last day of this month with the following:

If this IS the last day of the month, then I'm done.

Otherwise, the last day of this month is equal to: Date(Year(Today()), Month(Today())+1,1)-1
{In other words, using the DATE function, specify the Year(of Today) and the Month(of Today) + one more month (next month), and the 1st day of next month.  Then subtract one day (equals last day of this month).

Am I missing something?  Helper II

This formula can be used for more accuracy:

``subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'second')`` New Member

How Can I use formula on Power Automate Desktop? It is right?

Completed Ideas