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 / Alert noticed to chang...
Power Apps
Suggested Answer

Alert noticed to change from CountRows To CountIf

(2) ShareShare
ReportReport
Posted on by 22
I am using the below code on the label text properties, 

CountRows(WarrantyDataGallery.AllItems) & "  of  total Records : " & CountRows(colAllWarranty)
 
The code is bringing the correct result, and it was working since years without any warning, today I noticed below warning:
 
CountRows may return a cached value. 
Use CountIf(DataSource, true) to get the latest count.

Please guide, it need to replace the code the suggested method?.
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,442 Super User 2025 Season 2 on at
    Hi
     
    That is new to me, I haven't seen that, although I believe multiple people mentioned it.
  • MIA Profile Picture
    22 on at
    Dear Mr. Mike,
     
    As I mentioned in my earlier post that where ever there was CountRows used, all the places the alert is showing. BUT it was working since years without any alert.
     
    Just to update you, I change on one of the label text :  
    Before Code was :  
    CountRows(colAllList)
     
    Changed to :
    CountIf(colAllList, true)
     
    Found, brings the same result, and Alert mark disappears.
     
    At this stage confused and looking forward to an advise, What to do?.
    change all the CountRows to CountIf
     
     
    Please guide further.
     
    Regards
     
  • Suggested answer
    timl Profile Picture
    36,411 Super User 2025 Season 2 on at
    Hi MIA
     
    There's no need to change to CountIf(DataSource, true) in the scenario that you mention.
     
    This warning is designed for cases where the data source is Dataverse, CountRows is used without filtering, and the record count exceeds 50k records. Under these circumstances, Power Apps returns a cached count which may not be accurate. CountIf(DataSource, true) would be the way to achieve an accurate row count. 
     
    There are more details in the documentation here.
     

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

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard