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 Apps
Answered

CountIF question

(0) ShareShare
ReportReport
Posted on by 402

I need to do a countif (to return an integer) if the SharePoint list record matches the Last AND First Names from a different data source being brought in.  I have this, but there is a delegation warning: 

CountIf('Consumer List',ThisItem.LastName = LastName && ThisItem.FirstName = ThisItem.FirstName)

I want to use this in the text of a label in a datacard of a gallery.

The gallery Items is this:

Sort(GroupBy(ShowColumns('Consumer Orders',"FullName","Street","Apt","DOB","LastName","FirstName","ZIP","City"),"FullName","Street","Apt","DOB","LastName","FirstName","ZIP","City","FullNames"),FullName,Ascending)

 

If I do just a CountIf and use 'Consumer List'.FirstName, I get a non-delegated value.  Or is there a better way to do this?  I ultimately want to get a 'weighted' value based on matches between the two datasets.

 

 

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    If your datasource will not go over the 2k limit you do not need to worry about delegation warnings, they will not be showed to your users.

     

    That being said CountRows, COuntIf etc are not delegable as of yet. SO you will always get that error when using them on sharepoint. Only way around that would be to collect the data first then counting the local collection

    See Sharepoint Delegation

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @iskguy 

    You can avoid the delegation warnings and issues, but your formula is not accurate for the CountIf.

     

    Please consider changing your Formula to the following:

    CountRows(
     Filter('Consumer List',
     LastName = LastName && FirstName = ThisItem.FirstName
     )
    )

    If that still provides delegation or other warnings, change it to:

    With({_items:
     Filter('Consumer List',
     LastName = LastName && FirstName = ThisItem.FirstName
     )
     },
     CountRows(_items)
    )

     

    I hope this is helpful for you.

  • iskguy Profile Picture
    402 on at

    Thanks for the reply.  The main dataset is around 50K records.  The other is around 1000K depending on use,

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

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard