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 / Formulas for Weekly Ca...
Power Apps
Answered

Formulas for Weekly Calendar

(0) ShareShare
ReportReport
Posted on by 53

Hi All-

I am working on my first Canvas app in Power Apps. I have a date picker (DatePicker1), a Horizontal Gallery (gal_Calendar_Days), and a Label (lbl_SunDate) on my screen. I want to select a date in the date picker (any date in a week), and have the horizontal gallery display the week, Sunday to Saturday. I have the following formulas:

 

In gal_Calendar_Days.Items:

ForAll(Sequence(7), {date: DateAdd(DatePicker1.Value, -Weekday(DatePicker1.Value, StartOfWeek.MondayZero), Days)}) 

 

In lbl.SunDate.Text:

Text(ThisItem.date-Weekday(ThisItem.date,2)+1, "dddd m / dd")

 

When I select a date, the calendar populates with the Monday date of the selected week, but the days do not increment. I've been working on this for days, with little progress. Can somebody guide me in the right direction?

Thanks!

 

Screenshot 2.pngScreenshot 1.png

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Nuke_It_Newport ,

     

    Please use below formula instead:

    ForAll(Sequence(7) As S, {date: DateAdd(DatePicker1.SelectedDate, -Weekday(DatePicker1.SelectedDate, StartOfWeek.MondayZero)+S.Value-1, Days)})

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Nuke_It_Newport Profile Picture
    53 on at

    Thanks! When I change my code to the formula you provided, The week dates don't populate at all. Is there something else I'm missing?Screenshot 3.png

  • Nuke_It_Newport Profile Picture
    53 on at

    @v-jefferni I figured out my error. I had to change "DatePicker1.SelectedDate" back to "DatePicker1.Value", and then your formula worked. Thanks for your help! 👍

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard