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 / 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 2026 Season 1 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 2026 Season 1 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 2026 Season 1 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

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 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard