Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

Displaying items that were created last month in powerapps

Like (0) ShareShare
ReportReport
Posted on 6 Sep 2022 17:49:07 by 166

I am trying to display the count of items that were created last month lets say now August 2022. 

 

here is my code 

With(
{
StartDate: Date(
Year(Today()),
Month(Today()) - 1,
1
),
EndDate: Date(
Year(Today()),
Month(Today()),
1
) - 1
},
ClearCollect(
collcreatedlastmonth,
Filter(
'mylist',
Created >= StartDate,
Created <= EndDate
)
)
);

 

I do have items created in August but it displays 0 . what is wrong with the formulae 

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 06 Sep 2022 at 18:18:23
    Re: Displaying items that were created last month in powerapps

    @KDAI 

    Please consider changing your Formula to the following:

    With(
     {StartDate: Date(Year(Today()), Month(Today()) - 1, 1),
     EndDate: DateAdd(Date(Year(Today()), Month(Today()) + 1, 1), -1, Days) 
     },
    
     ClearCollect(collcreatedlastmonth,
     Filter('mylist',
     Created >= StartDate,
     Created <= EndDate
     )
     )
    );

    This would include the prior month and any records in the current month.

     

    I hope this is helpful for you.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2