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 / CountRows is returning...
Power Apps
Unanswered

CountRows is returning a delegation error

(0) ShareShare
ReportReport
Posted on by 3,506

I have the following formula, but it is raising a delegation error:-

 

rowcounts.png

 

is there a way to fix this?

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    @johnjohn123 

    Short answer, No. CountRows isn't delegable. You can make the visibility of the error go away by using a With() statement but that won't change what data the formula returns/acts on.

     

    To fix, you can create a collection of your data then apply the formula to that. Bear in mind that if you need more than 2000 records you will need to apply some extra code

  • johnjohn123 Profile Picture
    3,506 on at

    @Anonymouswe already has 8,000 items inside the Activities SharePoint list and 1000 records inside the Project list.. so how we can fix this issue? what i am trying to do is to get the number of activities that are related to the Project and has the status = completed then divide the number by the total number of of activities under the project.. so how i can achieve this then?

     

    in short i have 2 SharePoint lists; Project Master & Activities. the Activities has a lookup field to the Project list named ProjectTitle, as follow:-

    title.png

  • Community Power Platform Member Profile Picture
    on at

    @johnjohn123 

     

    It seems you are filtering on 1 Project number only, is this correct? If so, and you know that there will NEVER be more than 2000 activities / Project then you could just do something like this

     

    With(
     {
     wCompleted: Filter(Activities, ProjectTitle.Value=varProjectdetails.Title, Status.Value = "Completed"),
     wAll: Filter(Activities, ProjectTitle.Value=varProjectdetails.Title)
     },
    
     CountRows(wCompleted) / CountRows(wAll) // add your formatting here
    )

    You can add your formatting where I've indicated - I was just lazy and didn't do it lol

     

    This will remove the delegation error but be aware that this formula will only ever bring back a maximum of 2000  records each for wCompleted and wAll. 

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