Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
POSPOS
Post Partisan
Post Partisan

How to exclude weekends with scheduled flows using Power Automate

Hi All,
I have a requirement to schedule a Power BI report as a PPT to users every month on 15th.
Requirement is to send on 15th of every month, but if 15th is a weekend (Saturday or Sunday) , then the flow should run on the next week day, i.e., if 15th is Saturday then flow should run on 17th and if 15th is Sunday, then flow should run on 16th.
Can someone please suggest on how this can be achieved.
 
This is the current flow I have:
POSPOS_1-1730823298731.png

 

1 ACCEPTED SOLUTION
vojtechsima
Super User
Super User

@POSPOS Hello,

here's my proposal.

vojtechsima_0-1730839253436.png

Recurence every day, then initialize variable as string with this inside of it:

 

if(
    and(
        not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 14)), 6)),
        not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 14)), 0))
    ),
    formatDateTime(addDays(startOfMonth(utcNow()), 14), 'yyyy-MM-dd'),
    if(
        and(
            not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 15)), 6)),
            not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 15)), 0))
        ),
        formatDateTime(addDays(startOfMonth(utcNow()), 15), 'yyyy-MM-dd'),
        if(
            and(
                not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 16)), 6)),
                not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 16)), 0))
            ),
            formatDateTime(addDays(startOfMonth(utcNow()), 16), 'yyyy-MM-dd'),
            null
        )
    )
)

 

(code basically checks whether 15th, 16th or 17th is weekend and find the earliest non weekend day to run it).

This gonna check what's the valid day for the run in the current month.

Then you have a condition that checks if today is that day and you then put the rest of your actions to the "TRUE" branch.

View solution in original post

5 REPLIES 5
vojtechsima
Super User
Super User

@POSPOS Hello,

here's my proposal.

vojtechsima_0-1730839253436.png

Recurence every day, then initialize variable as string with this inside of it:

 

if(
    and(
        not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 14)), 6)),
        not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 14)), 0))
    ),
    formatDateTime(addDays(startOfMonth(utcNow()), 14), 'yyyy-MM-dd'),
    if(
        and(
            not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 15)), 6)),
            not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 15)), 0))
        ),
        formatDateTime(addDays(startOfMonth(utcNow()), 15), 'yyyy-MM-dd'),
        if(
            and(
                not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 16)), 6)),
                not(equals(dayOfWeek(addDays(startOfMonth(utcNow()), 16)), 0))
            ),
            formatDateTime(addDays(startOfMonth(utcNow()), 16), 'yyyy-MM-dd'),
            null
        )
    )
)

 

(code basically checks whether 15th, 16th or 17th is weekend and find the earliest non weekend day to run it).

This gonna check what's the valid day for the run in the current month.

Then you have a condition that checks if today is that day and you then put the rest of your actions to the "TRUE" branch.

Relay9
Frequent Visitor

Hi @POSPOS 
1.
Recurrence Trigger: Set the recurrence trigger to run on the 15th of every month.

2. Condition to Check Day of the Week:

• After the “Recurrence” step, add a condition to check the day of the week.

• Use the dayOfWeek function to get the day. dayOfWeek(utcNow()) returns an integer (0 for Sunday, 1 for Monday, …, 6 for Saturday).

3. Branch Conditions:

• If dayOfWeek(utcNow()) == 6 (Saturday), add a delay or calculate the next weekday (17th).

• If dayOfWeek(utcNow()) == 0 (Sunday), schedule it to run the next day (16th).

4. Run Export and Email Steps:

• For each condition, add the “Export to File for Power BI Reports” and “Send an email” actions in the correct branch.

5. Fallback (Optional):

• In case the 15th is a weekday, directly proceed with the “Export to File” and “Send an email” actions without any delay.

 

This will ensure that your flow sends the report on the 15th or the next weekday if the 15th falls on a weekend.

Sergii24
Super User
Super User

Hi @POSPOS, I believe your question is more for Power Automate community rather than Power BI experts 🙂
You can post your question here - Microsoft Power Platform Community Forum Thread

 

However, what you want to do is:

  1. Indetify the day of the week (remember, Power Automate deals with dates in UTC time zone only!)
  2. If it's a weekend, add "delay" action until next Monday (you'd need to calculate the difference between the current time  and the desired time on Monday (rememebr about UTC timezone! )
  3. then send ppt 🙂

Good luck with your flow 🙂

@Sergii24  - Can you please provide detailed steps on how to achieve this as I am quite new to Power Automate.

@Relay9  has provided you a step-by-step guide 🙂

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors