cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtaylor
Frequent Visitor

countif on a choice field

I am trying to display how many times "Approved" is in a column in my list. I can get the countif function to work when the field it is counting is just a plain number or text, but for some reason when the field is of type "choice" it gives me errors. Here is an example:

 

working fuction on a column of type "text": Countif('Policy Exceptions', comments = "this is a comment")

 

not working because the column type is "choice": Countif('Policy Exceptions', Approval_Status = "Approved") this gives me a red underline on the '=' character.

 

Does anyone have any info on what you have to do to count fields of a choice column? i just want to count the amount of exceptions that have been set to "Approved"

 

Thanks for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

A choice column in sharepoint is a "complex type" - it will have the value that you see, plus an identifier. So you need to compare with the .Value property of the record:

Countif('Policy Exceptions', Approval_Status.Value = "Approved")

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

A choice column in sharepoint is a "complex type" - it will have the value that you see, plus an identifier. So you need to compare with the .Value property of the record:

Countif('Policy Exceptions', Approval_Status.Value = "Approved")

View solution in original post

wonderful! thank you so much!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,438)