web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering on date range
Power Apps
Unanswered

Filtering on date range

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I have a dropdown that is populating events on todays date using
Filter(EventCollect,Date(Year('Event Start Date and Time'),Month('Event Start Date and Time'),Day('Event Start Date and Time'))=Today())

 

Now I want it to populate events from today and for the past 7 days.

I'm trying this, but it appears to be showing all events today backward beyond the past 7 days.  

Filter(EventCollect,Date(Year('Event Start Date and Time'),Month('Event Start Date and Time'),Day('Event Start Date and Time')) < DateAdd(Today(),-7,Days))

 

Tips?

Categories:
I have the same question (0)
  • LRVinNC Profile Picture
    2,297 on at

    If I read your statement correctly, you are currently telling it to subtract 7 days from today to get a new date and compare then comparing Event Start Date against that new date that is 7 days prior to today.  I think what you are really trying to do is get those  where the date is GREATER THAN OR EQUAL to 7 days ago. (or simply greater than 8 days ago).

     

    I would try changing your -7 to a -8 and reversing the > to a < and see what you get.

  • Verified answer
    wyotim Profile Picture
    2,545 on at

    I think your inequality is the issue. You are looking for everything smaller than (i.e. earlier than) a date that is seven days before today.

    You might try the following:

    Filter(
     EventCollect,
     Date(
     Year('Event Start Date and Time'),
     Month('Event Start Date and Time'),
     Day('Event Start Date and Time')
     ) >= DateAdd(Today(),-7,Days)
    )

    If there is the possiblity of dates bigger than (i.e. later than) today, you might want to add the following:

    Filter(
     EventCollect,
     Date(
     Year('Event Start Date and Time'),
     Month('Event Start Date and Time'),
     Day('Event Start Date and Time')
     ) >= DateAdd(Today(),-7,Days),
     Date(
     Year('Event Start Date and Time'),
     Month('Event Start Date and Time'),
     Day('Event Start Date and Time')
     ) <= Today()
    )
  • russrimm Profile Picture
    Microsoft Employee on at

    Thank you the 2nd example you gave is exactly what I needed!!  Much appreciated.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard