web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 5wkCmYv7ZS+i2gp6kn2VXS
Power Apps - Building Power Apps
Unanswered

Countif function is not returning a result

Like (0) ShareShare
ReportReport
Posted on 13 Jul 2019 05:44:48 by

I am trying to create some logic based on the result of a countIf function but for some reason the countif function is returning a 0 result even though it should be returning a count of 4 for the particular record I am looking at, but if I use the same operation and combine a CountRow and Filter formulas, it returns the correct result. Any ideas on why CountIF is not working even though it is the same exact condition? These formulas are entered into fields in a gallery.



CountRows(Filter('[dbo].[tblData_VendorMasterSSPaymentTerms]',ThisItem.VMSSPayTermsCLM_ContractID=VMSSPayTerms_AribaContractID))



CountIf('[dbo].[tblData_VendorMasterSSPaymentTerms]',ThisItem.VMSSPayTermsCLM_ContractID=VMSSPayTerms_AribaContractID)

I have the same question (0)
  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on 13 Jul 2019 at 08:45:17
    Re: Countif function is not returning a result

    Hi @Anonymous 

     

    Can you try to modify your CountIf formula as:
     
    CountIf('[dbo].[tblData_VendorMasterSSPaymentTerms]',VMSSPayTerms_AribaContractID=ThisItem.VMSSPayTermsCLM_ContractID)

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-yutliu-msft Profile Picture
    on 15 Jul 2019 at 02:39:53
    Re: Countif function is not returning a result

    Hi @Anonymous ,

    Do you mean that these two formulas return different results?

    Did you get delegation warning?

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

  • Community Power Platform Member Profile Picture
    on 15 Jul 2019 at 02:44:01
    Re: Countif function is not returning a result
    Yea I tried flipping the condition. no avail unfortunately.
  • Community Power Platform Member Profile Picture
    on 15 Jul 2019 at 02:44:51
    Re: Countif function is not returning a result
    Yea the countif function returns 0 when it should be 4.

    The combination of count rows and filter returns the correct result, but includes a delegation warning
  • v-yutliu-msft Profile Picture
    on 15 Jul 2019 at 02:50:47
    Re: Countif function is not returning a result

    Hi @Anonymous ,

    Well, that should be related to delegation problem.

    That's PowerApps itself limit.

    If your record is smaller than 2000, you could change the limit to 2000 to avoid this problem.7124.PNG

     

    If your record is lager than 2000, you should use delegable functions. If you do not use, you may get wrong result like your issue.

    Here are some docs about delegable functions:( different data source have different delegable functions)

    https://docs.microsoft.com/en-us/connectors/commondataservice/

    https://docs.microsoft.com/en-us/connectors/sharepointonline/

    https://docs.microsoft.com/en-us/connectors/sql/

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • Community Power Platform Member Profile Picture
    on 15 Jul 2019 at 02:52:21
    Re: Countif function is not returning a result
    I would agree but the count if formula is.not returning the correct result and is not the getting a delegation warning.

    The formula that is returning the correct result has the delegation warning so that is not the issue.
  • LegoLad20 Profile Picture
    2 on 23 Sep 2020 at 14:38:43
    Re: Countif function is not returning a result

    Hey @Anonymous , 

    Were you able to find a solution to this? I am having the exact same issue currently.

     

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard
Loading complete