Live Developer Training: next batch coming soon. Be the first to know.Live training: next batch soonJoin the waitlist →Join →

How to Check IF the Date is Weekend in Power Automate?

In our leave management application, I needed to calculate leave days while ensuring weekends were excluded from the total count. Since weekends shouldn’t be considered leave days, I had to find a way to check if a given date falls on a Saturday or Sunday.

After some research, I found an efficient way to identify and exclude weekends from the leave calculation using Power Automate.

In this tutorial, I will show you how to check if the date is weekend in Power Automate. Additionally, I will also guide you on how to calculate working days while excluding weekends.

Check IF the Date is Weekend in Power Automate

Suppose you work in an IT support team managing tasks in a SharePoint list called Task Tracker. Each new task automatically gets a due date set 2 days after creation. However, if this due date falls on a weekend (Saturday or Sunday), it should be adjusted to the next Monday.

For example, I am using the below SharePoint List:

Calculating workend days in Power Automate

To do this, follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger When an item is created. Also, provide the Site Address and List Name.

How do you determine the day of the week in Power Automate

2. Add a Compose action to Calculate the Initial Due Date using the below expression:

addDays(utcNow(),2,'MM/dd/yyyy')
How to check if the date is weekend in Power Automate

3. Then add another Compose action to Check if the Due Date Falls on a Weekend using the below expression:

dayOfWeek(outputs('Compose'))
Power Automate to calculate Due Date for a task

4. Then add Switch Condition to update the due date.

  • On: Take the Output of the Compose 1 action from the dynamic content.
Identifying Weekends From Date Column in Power Auotmate

5. Click + Add case to add the first switch case. Manually enter the value 6 (Saturday) inside the Equals parameter.

Identify weekends in between start time and end time in Power Automate

6. Add the Update item action inside the case, providing the Site Address, List name, and ID. Then, expand Advanced parameters and give the due date as below expression:

addDays(utcNow(), 4, 'MM/dd/yyyy')
How to check if a date is a weekend or a holiday

7. Click + Add case to add the first switch case. Manually enter the value 0 (Sunday) inside the Equals parameter.