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 / How can I filter a col...
Power Apps
Answered

How can I filter a collection for records from the previous specific date?

(0) ShareShare
ReportReport
Posted on by 50

I have a collection with a field called 'submitted' which is a date and time field. I want to count the rows of records which have a submitted date after the 1st Septmber - but this has to be the most recent september that has past.

 

This is basically to count how many records have been submitted in the acedemic school year (which in the UK starts in September.)

 

I am using this code to filter the number of rows submitted for the current month.

 

CountRows(Filter(colWellbeing,Month(Submitted)=Month(Now())))

 

 

But I'm not sure how to adapt the date to get records since the previous 1st September.

Categories:
I have the same question (0)
  • Verified answer
    rzuber Profile Picture
    552 Moderator on at

    What about something like this?

     

     

    With(
     {_start: Date(Year(Today()) - If(Month(Today()) < 9, 1), 9, 1)},
     CountRows(Filter(colWellbeing, Submitted >= _start))
    )
     

     

    [EDIT] Sorry for moving the year to the end of the function parameters. My brain was malfunctioning yesterday. 😁

  • mrwilliams Profile Picture
    50 on at

    Thanks @rzuber . I will try it. I find a solution with the following method:

     

    If(
     Or(
     Month(Now()) = 9,
     Month(Now()) = 10,
     Month(Now()) = 11,
     Month(Now()) = 12
     ),
     CountRows(Filter(colWellbeing,Submitted>Date(Year(Now()),"09","01"))),
     CountRows(Filter(colWellbeing,Submitted>Date(Year(Now())-1,"09","01")))
    )
  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    Hi @mrwilliams ,

    Posting a more condensed version of that - also @rzuber is correct.

    CountRows(
     Filter(
     colWellbeing,
     Submitted >
     Date(
     Year(Now()) - 
     If(
     Month(Now()) < 9,
     1
     ),
     9,
     1
     )
     )
    )

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard