web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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
    193 Moderator 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard