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 / Count number of items ...
Power Apps
Unanswered

Count number of items in SharePoint list based on text values?

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

 

I have a label in a gallery where I want it to show the total number of items in a SharePoint list based on a text field.

 

The label is on a gallery named "galTopics" and I wish is to lookup the number of items in the gallery named "galSubtopic".

 

The Items property of "galTopics" is set to:

 

Filter(TopicsClaims,Building = galDocData.Selected.spBuilding)

 


The Items property of "galSubtopic" is set to:

 

Filter(SubtopicArgEvi_1, Building = TopicBuildingValue.Text && Topic = TopicDD.Selected.Value)

 

 

So for the label on "galTopics" I want to show the number of Subtopics in "galSubtopic" with the same Topic value that is in "galTopic".

 

I've tried this but no luck:

CountRows(
Filter(
SubtopicArgEvi_1, 
Topic = galTopics.Selected.Topic))

 

Any suggestions?

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,577 Super User 2026 Season 1 on at

    Hi @sudosaurus ,

     

    Assuming the label is inside galTopics, this is how to show the number of subtopics per topic:

    CountIf(
     SubtopicArgEvi_1,
     Topic = ThisItem.Topic
    )

     

  • WarrenBelz Profile Picture
    154,492 Most Valuable Professional on at

    Hi @sudosaurus ,

    What about simply using the Items of the sub gallery

    CouintRows(
     Filter(
     SubtopicArgEvi_1, 
     Building = TopicBuildingValue.Text && 
     Topic = TopicDD.Selected.Value
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @BCBuizer that kinda worked however it is returning all values that match the name, which is what I don't want.

     

    I've just tried this instead and that's not working for me:

    CountIf(SubtopicArgEvi_1, Building = TopicBuildingValue.Text && Topic = ThisItem.Topic)


    Essentially if "Building1" is selected, you can add topics and "Building1" is patched to the Topics list so that we can ensure the right topics are being displayed for the building.  The same goes for the Subtopics list where the items are set to:

    Filter(SubtopicArgEvi_1, Building = TopicBuildingValue.Text && Topic = TopicDD.Selected.Value)


    So, I only want to display the number of topics that "Building1" has - "Building2" may have more or less.

    @WarrenBelz - I also tried your suggestion but errored for me.

  • BCBuizer Profile Picture
    22,577 Super User 2026 Season 1 on at

    Hi @sudosaurus ,

     

    Can you please share what is not working about the formula you said you tried? From first glance it looks correct:

    CountIf(
     SubtopicArgEvi_1, 
     Building = TopicBuildingValue.Text && Topic = ThisItem.Topic
    )

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @BCBuizer 

    sudosaurus_0-1695731278061.pngsudosaurus_1-1695731318896.png

     

  • BCBuizer Profile Picture
    22,577 Super User 2026 Season 1 on at

    Hi @sudosaurus ,

     

    As the error mentions, this formula created a circular error. Is the TopicBuildingValue control inside the TopicsClaimForm by any chance? If it is, I suggest using another control out side of the form to select the building.

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

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard