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

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,297 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard