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 / Filter by week from a ...
Power Apps
Answered

Filter by week from a SharePoint calendar of events

(0) ShareShare
ReportReport
Posted on by 149

Hi,

I have a Sharepoint Calendar in which classes are added with Start & End Dates of a course. So most are recurring over a few weeks (please see attached - there are 2 courses running 6 times each).

The teacher is assigned classes as Attendees (People Picker).

recurring_events.PNG

I am trying to work out how to filter a gallery so it only shows the Events happening between two dates.

 

I currently have:

 

Mo_Islam_0-1593536668834.png

 

 

Filter(Test_Rabat, DateValue(Text('Start Time',ShortDate)) >= DateValue(Text(DatePickerFrom.SelectedDate,ShortDate)) && DateValue(Text('End Time',ShortDate))<= DateValue((Text(DatePickerTo.SelectedDate,ShortDate))))

 

 

Problem:

  • Nothing shows in the gallery - ONLY when I select 2 Jun to 7 Jul both courses show up.
    • I need to be able to filter for all events within two dates i.e. showing recurring events
      e.g. If I choose 2 Jun to 9 Jun (a week) I shoudl see both courses as well but currently it appears blank. 
  • I also need to know how to be able to press the red arrow keys to scroll through weeks instead of choosing dates.

 

I thank you in advance. 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    If you want to display items even if no selection of Date.

     

    In that case:

    Select the DatePickers and on its InputTextPlaceholder and DefaultDate Property, put: Blank()

     

    Then Change the filter code to:

    If(IsBlank(DatePicke1) Or IsBlank(DatePicker2),
    Test_Rabat,

    Filter(Test_Rabat, DateValue(Text('Start Time',ShortDate)) >= DateValue(Text(DatePickerFrom.SelectedDate,ShortDate)) && DateValue(Text('End Time',ShortDate))<= DateValue((Text(DatePickerTo.SelectedDate,ShortDate)))))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Mo_Islam Profile Picture
    149 on at

    Hi @eka24  thank you for  a prompt response. I think my message was not clear, so I have updated my post which hopefully will make it clearer. I need the events from the Sharepoint calendar to show for recurring events but within the dates selected.

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Mo_Islam ,

    Q1:

    Do you mean that your filter function only works when you select 2 Jun to 7 Jul, but not work when you choose  2 Jun to 9 Jun?

    Try this formula:

    Filter(Test_Rabat, 
    DateValue(Text('Start Time',ShortDate)) >=DatePickerFrom.SelectedDate,
    DateValue(Text('Start Time',ShortDate)) <=DatePickerTo.SelectedDate,
    DateValue(Text('End Time',ShortDate)) <=DatePickerFrom.SelectedDate,
    DateValue(Text('End Time',ShortDate)) <=DatePickerTo.SelectedDate
    )

    If the problem still exists, could you tell me how many records are in your data source?

    If it it smaller than 2000, you just need to change the delegation limit to 2000:
    delegation.jpg

     

    If your data source has more then 2000 records, then you need to figure out delegation problem.

    Since "<>" does not delegate for sharepoint, so in your issue, I suggest you use collection to avoid delegation problem.

    The solution is: save your data to collection, then filter that collection.

     

    Q2:

    Could you tell me how many days do you want to scroll by clicking the red icons?

    I assume that :
    if you click "<", selected date of DatePickerFrom will scroll back one week.

    if you click ">", selected date of DatePickerTo will scroll front one week.

    If so, try this:

    set the "<" button's OnSelect:

    Set(fromdate,DateAdd(DatePickerFrom.SelectedDate,-7,Days));Reset(DatePickerFrom)

    set DatePickerFrom's DefaultDate:

    If(IsBlank(fromdate),Today(),fromdate)

    set the ">" button's OnSelect:

    Set(todate,DateAdd(DatePickerTo.SelectedDate,7,Days));Reset(DatePickerTo)

     set DatePickerTo's DefaultDate:

    If(IsBlank(todate),Today(),todate)

     

    Then if you click the "<" button, selected date in fromdatepicker will scroll back one week.

    If you click the ">" button, selected date in todatepicker will scroll front one week.

     

     

    Best regards,

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 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard