Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Countif and If True

(1) ShareShare
ReportReport
Posted on by 629

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:
  • jamescosten Profile Picture
    629 on at
    Re: Countif and If True

    The Second one did the job thank you.

  • Verified answer
    Shaheer Ahmad Profile Picture
    2,194 Super User 2025 Season 1 on at
    Re: Countif and If True

    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"))
  • SanmeshG Profile Picture
    1,938 Super User 2025 Season 1 on at
    Re: Countif and If True

    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

  • timl Profile Picture
    34,933 Super User 2025 Season 1 on at
    Re: Countif and If True

    @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")
    )
  • jamescosten Profile Picture
    629 on at
    Re: Countif and If True

    jamescosten_0-1686565969447.png

     

  • Shaheer Ahmad Profile Picture
    2,194 Super User 2025 Season 1 on at
    Re: Countif and If True

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard