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 / CountIf and Help avoid...
Power Apps
Answered

CountIf and Help avoiding delegation flag

(0) ShareShare
ReportReport
Posted on by 72

Hello, 

I am getting a delegation flag with formula below. Trying to count row data for current year. Simplified the formula. I have more selected FieldName = " ", but no need to show long formula in this forum.  The formula yields right count. Just try to build app without delegation flags. 

 

CountIf(Gateways, Region = "North America" && Year('Dates') = Year(Today()) && Reference_Only.Value = "No" && (FieldName.Value = "ABC" || FieldName.Value = "DEF"))

Thanks for the assistance. 
Kevin

Categories:
I have the same question (0)
  • lcimon Profile Picture
    89 on at

    Hello,

     

    You get away from this delegation issue by:

    1. Adding a new column to you datasource to store the Year only. This will help to remove the part Year('Dates') of your formula.
    2. Spliting your formula in 2 steps (the CountIf function isn't delegable) as following:
    With(
     {pRecords: Filter(Gateways, Region = "North America" && YearOnly = Year(Today()) && Reference_Only.Value = "No" && (FieldName.Value = "ABC" || FieldName.Value = "DEF"))},
     CountRows(pRecords)
    )

    Where YearOnly is your new column.

  • radiosonicfan Profile Picture
    72 on at

    Thanks. Think I can ignore. Have under a 1k records and generate about 400-600 records a year.  Assuming if we generated 1k/records/year. It would take a while to hit 50K delegation limit. 

     

    "There is a 50K delegation limit if you use CountRows and CountIf functions with filters. There is no hard limit on the CountRows function when extracted directly from the data source because of the cached count that Dataverse keeps"

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @radiosonicfan :

    I am afraid it is impossible to solve the delegation problem in your formula.

    The point is that "CountRows","Year" are not a delegable functions.Although the delegation warning can be eliminated by using the With function, the limitation still exists.For example:

    I have a list named "BofNewTest" which has 9391 records

    vbofengmsft_0-1633584384678.png

    But I can still only get 500 by this formula although there is no delegation warning.

    vbofengmsft_1-1633584429210.png

    In addition,using Flow can increase the limit of 2k to 5K

    vbofengmsft_3-1633585649272.png

     

    vbofengmsft_2-1633585636535.png

    Best Regards,

    Bof

     

     

  • radiosonicfan Profile Picture
    72 on at

    @v-bofeng-msft Thanks for the feedback. I am going to avoid my I want to do and rely on a Qlik Dashboard for some light metrics reporting. Not going to hold my breathe for Microsoft to implement delegation for CountRows. Planned and 4 years has ticked by....

    radiosonicfan_0-1633980862962.png

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard