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 / show only startof week...
Power Apps
Unanswered

show only startof week day in canvas app gallery

(0) ShareShare
ReportReport
Posted on by 237

 

Hi Team,

 

     In canvas app i have two datepickers start date and end date and right and left arrow. my requirement is when user select the dates show the weekstartday i.e.monday dates will show in gallery and right and left arrowes,left arrow for previous monday of start dates and right arrow for next monday after enddate.how can achieve thisone please help me.

 

Powerappsuser11_0-1701245318618.png

 

Categories:
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @Powerappsuser11 

     

    try the following:

     

    put this code in the onselect of your date picker

    StartOfWeek(StartDatePicker.SelectedDate, WeekStart.Monday)

     

    this on left arrow:

    StartDatePicker.SelectedDate - 7

     

    on the right arrow:

    EndDatePicker.SelectedDate + 7

     

    Let me know if my answer helped solving your issue.
    If it did please accept as solution and give it a thumbs up so we can help others in the community.

    Greetings

  • MudassarSZ365 Profile Picture
    591 on at

    Hi @Powerappsuser11 ,

     Use the StartOfWeek function to calculate the Monday of the selected start date.

     

     

    Set(StartDate, StartOfWeek(DatePicker1.SelectedDate, StartOfWeek.Monday))

     

     

    Set the gallery's Items property to show only the start date (Monday) calculated from the selected date.

     

     

    {Date: StartDate}

     

     

    To navigate to the previous Monday, update the StartDate variable to subtract a week.

     

     

    Set(StartDate, DateAdd(StartDate, -7, Days))

     

     

    Right Arrow OnSelect: To navigate to the next Monday after the end date, update the StartDate variable to add a week.

     

     

    Set(StartDate, DateAdd(StartDate, 7, Days))

     

     

    Update Gallery: Each time you update the StartDate, the gallery should automatically update to show the new week's Monday.

    Set the StartDate variable on the OnSelect property of the left arrow icon:

     

     

    Set(StartDate, DateAdd(StartOfWeek(DatePicker1.SelectedDate, StartOfWeek.Monday), -7, Days))

     

     

    Set the StartDate variable on the OnSelect property of the right arrow icon:

     

     

    Set(StartDate, DateAdd(StartOfWeek(DatePicker2.SelectedDate, StartOfWeek.Monday), 7, Days))

     

     

    Set the Items property of the gallery to:

     

     

    {Date: StartDate}

     

     

    If this solution helps you, please mark it as the solution and leave a thumbs up. Thank you! 😊

     

  • Powerappsuser11 Profile Picture
    237 on at

    Hi @MudassarSZ365 ,

     

        Thanks for quick respond,

      

     While using startof week function getting below error please help me.

    Powerappsuser11_0-1701250013735.jpeg

     

  • MudassarSZ365 Profile Picture
    591 on at

    @Powerappsuser11 ,

    You can try this for start of week

    Set(StartDate, StartOfWeek(DatePicker1.SelectedDate, FirstDayOfWeek.Monday))

    If the provided information resolves your query, I'd appreciate it if you could mark it as the solution and leave a thumbs up. Thank you! 😊

     

  • Powerappsuser11 Profile Picture
    237 on at

    Hi @MudassarSZ365 ,

     

       Getting same,not recognized.please provide correct way approach.

     

    Powerappsuser11_0-1701253243941.jpeg

     

     

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
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard