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 to count the numbe...
Power Apps
Answered

How to count the number of rows in powerapps?

(0) ShareShare
ReportReport
Posted on by 80

Philbert9879_1-1713336935371.png

Let's say the number of rows show 4 above, my current formula is: 

CountRows(DataTable1.Selected.NSN) does not work. The forumla to display the number of rows.
 
Regards,
Philbert

 

 

Categories:
  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Philbert9879 ,

     

    Do you want to count rows in DataTable?

    Please try this.

    CountRows(formula on the Items of DataTable)

     

    Best regards,

    Rimmon

  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    CountRows(TableName or GalleryName)

  • JamesYumnam Profile Picture
    on at

    There are two ways of achieving this:
    i. Use the modern control "Table". It shows the count of rows in the table by default.

    JamesYumnam_0-1713337820266.png

    ii. Your case where you are using the classic Datatable control. for this, in the Items property of your datatable, you must have written a Filter or Search PFx like the one shown below in my case. 

    JamesYumnam_1-1713337920516.png

    to get the row count, i have added a label and in the Text property, I have used this PFx.
    CountRows(the formula in the above Items property of the Datatable)

    JamesYumnam_2-1713338027781.png

     

    Note: CountRows(DataTable1.Selected.NSN)  will not work as it deals only with the selected record(s) in the data table.

    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.

    Visit my blog James Yumnam

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard