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 / Count Rows Last Month ...
Power Apps
Answered

Count Rows Last Month and This Month

(1) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I have an app where i'm wanting to click a button (last month) or another button (this month) and when you click the button, it will count the number of items created in a sharepoint list (using the default created field) last month and then the other button to count the number of items created this month. The result should show in a text input box, please help

 

Thanks in advance! 

Dave

Categories:
I have the same question (0)
  • Verified answer
    ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    Hi @Dave-ITMan , Try this: EDITED:

    OnSelect of (last month) button

     

     

     

    Set(
     gblvar_LastMonthCount,
     CountRows(
     Filter(
     ListName,
     Month(Created) = Month(Today()) - 1
     )
     )
    )

     

     

     

    OnSelect of (this month) button

     

     

     

    Set(
     gblvar_ThisMonthCount,
     CountRows(
     Filter(
     ListName,
     Month(Created) = Month(Today())
     )
     )
    )

     

     

     

     

    Then you can use these variable on the text input box default property alternatively. 

    NOTE: There might be issue with delegation.

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Dave-ITMan Profile Picture
    on at

    Hi @ANB ,

    Thanks for the reply, This Month seems to work fine but last month isn't showing any results when it should be displaying the number 3?

    Thanks

    Dave

  • ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    @Dave-ITMan I have updated the code. Please use the edited code.

     

    Thanks,

    ANB

  • Dave-ITMan Profile Picture
    on at

    Hi @ANB , still not working. It's not even giving me a zero for the last month, it's just a blank text input?

     

    Thanks

    Dave

  • ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    @Dave-ITMan I have added one Note to my post. Due to delegation it might be case. Can you share the screenshot please. Also what would be total count of items in list?

     

    Thanks,

    ANB

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
Kalathiya Profile Picture

Kalathiya 408

#2
WarrenBelz Profile Picture

WarrenBelz 382 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 328 Super User 2025 Season 2

Last 30 days Overall leaderboard