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 / Unable to filter Share...
Power Apps
Answered

Unable to filter SharePoint Event List based on date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a SharePoint Event List "Change Control Calendar".  When I pull it into PowerApps and sort, no prolem.  When I try and filter on the date, no records are returned.

 

Here's the front end variable set up:

 

Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
Set(_PreviousWeek, Filter(_AllChangeItems, DateValue(Text('Start Time')) >= DateValue(Text(DateAdd(Today(),-7,Days))))); Navigate(SelectView, ScreenTransition.Fade)

 

I am then using _PreviousWeek on the data item source:

 

Sort(_PreviousWeek,'Start Time', Descending)

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Have you tried it without all of the text conversions?

     

    Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
    Set(_PreviousWeek, Filter(_AllChangeItems, 'Start Time' >= DateAdd(Today(),-7,Days))); 
    Navigate(SelectView, ScreenTransition.Fade)

    Works well here!

     

    I hope that helps you out.

     

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Based on the issue that you mentioned, I think there is something wrong with the _PreviousWeek variable that you set within your app.

     

    I have made a test on my side, please consider take a try to modify your formula as below:

     

    Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
    Set(
    _PreviousWeek,
    Filter(
    _AllChangeItems,
    Value(Text('Start Time', "[$-en-US]yyyymmdd")) >= Value(Text(DateAdd(Today(),-7,Days), "[$-en-US]yyyymmdd"))
    )
    );
    Navigate(SelectView, ScreenTransition.Fade)

    Or

     

    Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
    Set(
    _PreviousWeek,
    Filter(
    _AllChangeItems,
    'Start Time' >= DateAdd(Today(), -7, Days)
    )
    );
    Navigate(SelectView, ScreenTransition.Fade)

     

    In addition, you could also consider take a try to use the following formula on the data item source directly (instead of using variable😞

    Sort(
    Filter(
    'Change Control Calendar',
    Value(Text('Start Time', "[$-en-US]yyyymmdd")) >= Value(Text(DateAdd(Today(),-7,Days), "[$-en-US]yyyymmdd"))
    ),
    'Start Time',
    Descending
    )

    Please take a try with above solution, check if the issue is solved.

     

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

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard