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 If True
Power Apps
Unanswered

Countif and If True

(1) ShareShare
ReportReport
Posted on by 643

I have a roll call app and i would like to have a label showing the number of employees on site who are fire marshalls.

jamescosten_0-1686565109365.png

CountIf('Fire Safety Employee Checklist',Onsite = true & Responsibility = " Fire Marshall")

 

It returns 0 but i have 3 Fire Marshalls Onsite and my FX only shows an amber warning : 

 

jamescosten_1-1686565189825.png

 

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    It seems like you're encountering an issue with your formula and the connector you're using. The error message suggests that the "CountIf" operation is not supported by the connector you're using in your roll call app. This might explain why your formula is not returning the expected result.

    To work around this issue, you can try using the "Filter" function instead of "CountIf" to achieve the desired result. Here's an example formula that should help you count the number of employees on site who are fire marshals:

    COUNT(FILTER('Fire Safety Employee Checklist', Onsite = true, Responsibility = "Fire Marshall"))

    This formula uses the "Filter" function to create a filtered view of the 'Fire Safety Employee Checklist' based on the conditions specified. It then uses the "Count" function to count the number of rows in the filtered view, which corresponds to the number of employees on site who are fire marshals.

    Give this formula a try and see if it returns the correct count for you.

  • jamescosten Profile Picture
    643 on at

    jamescosten_0-1686565969447.png

     

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

    @jamescosten 

    Count works against a single column table. Therefore, CountRows will work better in this situation. Note also that function names are case sensitive.

    CountRows(
     Filter('Fire Safety Employee Checklist',Onsite = true & Responsibility = " Fire Marshall")
    )
  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @jamescosten ,

     

    I think you have used & instead of && , please correct your formula as below. You can also use And keywrod instead of using &&.

     

    CountIf(
     'Fire Safety Employee Checklist',
     Onsite = true && Responsibility = "Fire Marshall"
    )

     

    If this helps do give this a thumbs up.

     

    Thanks,

    Sanmesh

  • Verified answer
    Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Sorry for the mistake. Try this:

    Count(Filter('Fire Safety Employee Checklist', Onsite = true, Responsibility = "Fire Marshall"))

    or:

    CountRows(Filter('Fire Safety Employee Checklist', Onsite = true, Responsibility = "Fire Marshall"))
  • jamescosten Profile Picture
    643 on at

    The Second one did the job thank you.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard