Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Exclude weekends from date field

(0) ShareShare
ReportReport
Posted on by 158

I wrote the below compose formulas to try and filter out weekends. The first two worked (compose 1 & 3) but Compose 2 failed. Hoping someone can help me write it. 

 

Compose - utcnow()

Compose 3 - dayOfWeek(formatDateTime(utcnow()))

Compose 2 - if( equals(dayOfWeek(formatDateTime(utcNow()),'4'),addDays(utcNow(),-3), addDays(utcNow(),-1)))

 

KhrystinaM_0-1705960025369.png

 

  • KhrystinaM Profile Picture
    158 on at
    Re: Exclude weekends from date field

    I ended up using @AbigailRausch formula, but I appreciate both responses. Thank you for your help. 

    @eliotcole 

  • Verified answer
    AbigailRausch Profile Picture
    48 on at
    Re: Exclude weekends from date field

    @eliotcole 's solution looks perfect! But if you were also curious about why your current expression was failing, it looked like it 1) had the "4" in single quotes (which isn't needed due to comparing with an integer) as well as 2) the main culprit, parentheses slightly off. (That's why you got an error saying it expected more arguments than it got).

    I think the expression is probably more like this:

    if(equals(dayOfWeek(formatDateTime(utcNow())),4),addDays(utcNow(),-3), addDays(utcNow(),-1))
  • eliotcole Profile Picture
    4,260 Super User 2025 Season 1 on at
    Re: Exclude weekends from date field

    Hi, @KhrystinaM, try this:

    if(
    	equals(
    		dayOfWeek(utcNow()), 
    		0
    	), 
    	addDays(
    		utcNow(), 
    		1
    	), 
    	if(
    		equals(
    			dayOfWeek(utcNow()), 
    			6
    		), 
    		addDays(
    			utcNow(), 
    			2
    		), 
    		utcNow()
    	)
    )

    That should add one day if today is Sunday, two if it is Saturday, and none for any other day.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1