Hello dear Colleagues!
Currently I'm working on leave management flow for a company.
And I'm struggling with such issue: how to calculate vacation balance, not including weekends and holidays?
I would like that users will choose a date from/to of their vacation and power automate could calculate vacation balance not including weekends and holidays. I hope that I've described the idea correctly.
Maybe someone have done already smth similar?
Thank you!
Hi @daria_227
To find the day of the week there is an expression called dayofWeek() which returns value between 1 to 7
Monday 1, Tuesday 2,.... Sunday 7
Expression I used above is dayofWeek(utcNow()). This will return todays day of the week. If you want to pass another date to check then pass the date instead of utcNow() function. See below.
dayofWeek('2022-10-12')
To find the other holidays you need to store those dates for the relevant year in SharePoint or Excel or some database. Query the data source with the date you want to check.
Thanks
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2