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:

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.

2. Add a Compose action to Calculate the Initial Due Date using the below expression:
addDays(utcNow(),2,'MM/dd/yyyy')

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

4. Then add Switch Condition to update the due date.
- On: Take the Output of the Compose 1 action from the dynamic content.

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

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')

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

8. Add the Update item action inside Case 2, providing the Site Address, List name, and ID. Then, expand Advanced parameters and give the due date as below expression:
addDays(utcNow(), 3, 'MM/dd/yyyy')

9. Add the Update item action inside the default case, providing the Site Address, List name, ID. Then, expand Advanced parameters and provide Compose action output using dynamic content.

Save the flow, go to the SharePoint list, and add an item.

After the flow runs successfully, refresh the SharePoint list. You will see that the due date is 3/24/2025 because Today is Friday.

Calculate Working Days While Excluding Weekends in Power Automate
Suppose you’re building a leave request system where employees submit a leave request with a Start Date and End Date. You must calculate the number of leave days, excluding Saturdays and Sundays.
To do this, follow the below steps:
1. Open the Power Automate Home page and choose Instant cloud flow with trigger Manually trigger a flow. Click on +Add an Input to add two date inputs (Start Date and End Date) to allow users to manually enter the leave period.

2. Add a compose to calculate the total number of days (including weekends) between the given Start Date and End Date using the below expression:
dateDifference(triggerBody()?['date'],triggerBody()?['date_1'])

3. Add another Compose action and provide the below expression:
add(int(split(outputs('Compose'),'.')?[0]),1)
Where:
- The dateDifference() function might return a decimal value, so split(outputs(‘Compose’),’.’)?[0] extracts the whole number part.
- int(…) converts this value into an integer.
- add(…,1) ensures that the total count includes both the start and end dates (making it an inclusive count).

4. Then add a select action and provide the below parameters:
- From: Provide below expression:
range(0,outputs('Compose_1'))
- Map: Click the T icon and give the below expression:
{
"Date": @{addDays(triggerBody()?['date'],item())},
"Day": @{addDays(triggerBody()?['date'],item(),'dddd')}
}
It generates a list of dates between the Start and End Dates. It also identifies the day of the week for each date.

5. Add a Filter array action and provide the below parameters:
From:
@{body('Select')}
Filter Query:
@{and(not(equals(item()?['Day'],'Saturday')),not(equals(item()?['Day'],'Sunday')))}
This step removes Saturdays and Sundays from the list of dates. It ensures that only working days (Monday to Friday) are counted.

6. Add a Compose action and provide the below parameter:
length(body('Filter_array'))
This step counts the number of working days after removing weekends. The output will be the total number of leave days, excluding Saturdays and Sundays.

Run the Flow to Calculate Working Days While Excluding Weekends
Now, save the flow. -> Click Test (top-right corner) -> Select Manually and click Test again. -> Enter Start Date & End Date in the input fields.
For Example: Start Date: 2025-03-18, End Date: 2025-03-25

Click Run flow and wait for execution. After the flow runs successfully, you can see the number of days in the last compose action.

Conclusion
In this tutorial, I explained two key scenarios in Power Automate: checking if a date falls on a weekend and calculating working days while excluding weekends. First, I showed how to adjust a due date in a SharePoint list if it falls on a Saturday or Sunday.
Then, I explained how to calculate leave days in a leave request system, ensuring weekends are not counted. We efficiently determined the correct working days by using expressions and actions like Compose, Select, Filter array, and Update item.
Moreover, you may like some more Power Apps tutorials:
- Get SharePoint List Column Details Using Power Automate
- Power Automate IF Length
- Power Automate Condition If String
- Send Birthday Wishes Using Power Automate
- Check If the Body is Empty in Power Automate
- Check If the Column is Changed in Power Automate
- Rename SharePoint List Using Power Automate

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.