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 Apps / How to get all weekend...
Power Apps
Answered

How to get all weekend dates in a month?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I want to build an HR app that tells me when someone goes on holiday and at the end of each month i can generate a PDF that contains all days in that month.

If someone had a holiday approved that day write 'A' in the PDF table, if that day it was a specific holiday write 'FREE' and if that day its weekend write 'W.E'

So far i have the logic behind holiday approval, i can generate a PDF for a month of my choice that tells me who, holiday period and what type of holiday everyone had during that month. But how can i find the weekend days and fill the specific table cell.

I've attached a photo with the table i want to generate

 

Capture.PNG
Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    How do you list the days within a month in your app? Using Gallery?

    Do you want to get all weekend dates within current month?

     

    If you want to get all weekend dates within current month, I have made a test on my side, please consider take a try with the following workaround:

    7.JPG

    Set the OnSelect property of the "Calculate" button to following:

    Clear(WeekDaysCollection);
    ForAll(
     FirstN([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30], DateDiff(Date(Year(Today()),Month(Today()),1), Date(Year(Today()),Month(Today())+1,1))),
     If(
     Weekday(Date(Year(Today()),Month(Today()),1) + Value)=1 || Weekday(Date(Year(Today()),Month(Today()),1) + Value)=7,
     Collect(WeekDaysCollection, Date(Year(Today()),Month(Today()),1) + Value)
     )
    )

    then add a Data Table control, set the Items property to following:

    WeekDaysCollection

    then all weekend dates within current month would be listed within the Data table.

     

    If you want to display the days table as your screenshot mentioned in a canvas app, I afraid that there is no direct way to achieve your needs. As an alternative solution, you could consider add a Gallery control in your app to list all days in current month within the Gallery:

    Set the Items property of the Gallery to following:

    ForAll( 
     FirstN([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30], DateDiff(Date(Year(Today()),Month(Today()),1), Date(Year(Today()),Month(Today())+1,1))),
     Date(Year(Today()),Month(Today()),1) + Value 
    )

     

    If you want to check if current date is weekend date, you could use the following formula:

    If(
     "Specific Date Value" in WeekDaysCollection,
     "W.E"
    )

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This really helped and i created my table with it. 
    Is it a way to get the weekend dates in a month selected from a dropdown box?

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard