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 to co...
Power Apps
Suggested Answer

CountIf Function to count total number of times an option is selected from a drop down list

(1) ShareShare
ReportReport
Posted on by
I have a page on my app that has 34 drop down lists that are to be used to record patient acuity per bed. The options within the drop downs are all the same for every bed - Empty, Level 0, Level 1a, Level 1b, Level 1c, Level 1d, Level 2, Level3.
I want the page to be able to total the amount of each level that is recorded. For example - Empty = 2, Level 0 = 20, Level 1a = 2, Level 1b = 0, etc.
I have tried to do this by making a collection and then using a countif on that selection but I can't seem to make the formula total the whole collection, rather than pulling from individual collumns.
Would anyone be able to help?
The formula I have currently: 
CountIf(SelectionsCollection, Room1 = "Empty")
 
This works fine when counting a single column within the collection but I can't figure out how to get it to total the times each level is mentioned within the collection.
 
Categories:
I have the same question (0)
  • Suggested answer
    Ytalo Silva Profile Picture
    181 Super User 2025 Season 2 on at
    Hello, you can try this 
    With({
        calculateLevels: ForAll(
            Distinct(RoomCollection; Room1) As Temp,
            {
                Name: Temp.Value,
                Value: CountIf(
                    RoomCollection,
                    Room1 = Temp.Value
                )
            }
        )
    }, calculateLevels)
     This way, you can create a gallery and add this formula to the Items property

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard