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 / Filtering on date range
Power Apps
Answered

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard