web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calculate weekdays in ...
Power Automate
Unanswered

Calculate weekdays in approval process

(0) ShareShare
ReportReport
Posted on by

Hi,


I have an approval workflow where by i am using ticks to calculate days between request and completion date. Can you please help in how to only calculate weekdays?


thank you in advance!

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,685 Super User 2026 Season 1 on at

    There certainly is a propper algo for this, but you can also let PA do the work 🙂

    Here is my brute force solution:

    Chriddle_0-1689353490644.png

    Select

    From (This is a range from 0 to number of days, including end date):

    range(
    	0,
    	int(
    		split(
    			dateDifference(
    				outputs('Dates')['start'],
    				addDays(
    					outputs('Dates')['end'],
    					1
    				)
    			),
    			'.'
    		)[0]
    	)
    )

     Map (Check if weekday is 0 or 6. If so return , else 1):

    if(
    	contains(
    		createArray(0,6),
    		dayOfWeek(
    			addDays(
    				outputs('Dates')['start'],
    				item()
    			)
    		)
    	),
    	0,
    	1
    )

     

    Compose

    Input (Add all the numbers in the array created with the Select):

    xpath(
     xml(
     json(
     concat(
     '{"root":{"Number":',
     body('Select'),
     '}}'
     )
     )
     ),
     'sum(/root/Number)'
    )

     

     Output: 5

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard