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 function with ...
Power Apps
Unanswered

CountIf function with SharePoint list.

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I have a list (37 items currently) with actions that have a status of 'Open' or 'Closed'.

 

I'm trying to use a CountIf formula on that list via powerapps on a browse gallery to display the number of open actions on that row. 

 

e.g. Row 1 has 4 actions and two of them are open so I want the returned value of the CountIf function to be 2 on that item.

 

Below is my current formula that works to a degree.

 

CountIf('WALK Register',ThisItem.'Status 1'.Value = "Open")

 

This works but it will count all true values of that column which is currently showing 37. (So each row that has a true value under status will count all rows regardless of their value).

 

I'm under the pump and don't have much time to troubleshoot what I believe to be a simple formula so any help would be great.

 

Thank you.

Categories:
I have the same question (0)
  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @Anonymous 

    I would remove the reference to ThisItem in your formula and see whether or not that returns your desired result.

     

    CountIf('WALK Register', 'Status 1'.Value = "Open")

    Hope that helps.

  • Community Power Platform Member Profile Picture
    on at

    Hello @timl 

     

    That is getting me somewhere. Now it only shows open values but still shows it on every list. A picture of this is below.

     

    Untitled3.png

    I'm trying to show the Open values for 'each' list. 

     

    Hope this is a simple work around. Thank you for your help.

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @Anonymous 

    I don't think I fully understand how your data structured. In the gallery that's shown in your screenshot, do you have a sub-gallery that displays the 4 items for each item in your main gallery? If so, what formulas are you using?

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

    Hi @Anonymous ,

    The CountIf function is used to count records that meet the formula not the fields.

    Could you tell me the data type of state column?

    I assume that's a choice column.

    I suggest you try this formula:

    CountIf(Split(Concatenate(ThisItem.status1,",",ThisItem.status2,",",ThisItem.status3,",",ThisItem.status4),","),Result="Open")

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @Anonymous 

     

    As you want to get the count of a filter inside a subitem, you need to apply the countif on SubItem, rather than applying it to the data source. Can you please try out the below mentioned formula, this will get you the results for each gallery item corresponding to its sub gallery:
     
    Expression:
    CountIf(ThisItem.'Status 1',Value = "Open")
     
    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!
  • Community Power Platform Member Profile Picture
    on at

    Hello @v-yutliu-msft,

     

    You're a lifesaver! This is exactly what I was after. Tweaked the formula slightly but the below worked a charm.

     

    CountIf(Split(Concatenate(ThisItem.'Status 1'.Value,",",ThisItem.'Status 2'.Value,",",ThisItem.'Status 3'.Value,","),","),Result="Open")

     

    Thank you @yashag2255 & @timl for your excellent minds too. I appreciate you all.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard