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 / CountRows in Data Sour...
Power Apps
Answered

CountRows in Data Source if Status 'Active' or 'Other'

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have Table1.

I have Radio2.

I have Label.

Label1 has the following formula. I am trying to count the number rows in the data source that have 'ACTIVE' if "ACTIVE" is chosen in Radio2, or the number of rows that have 'CML DIGITAL' if "CML DIGITAL" is chosen in Radio2.

I can only seem to get the entire count - 1008.

 

If(IsBlank(Radio2.Selected.Value),CountRows(Client_Collection),If(Radio2.Selected.Value = "ACTIVE" && ("ACTIVE" in Client_Collection.Subscriber_Status),CountRows(Client_Collection)))

 

Phineas_0-1708209908905.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,224 Most Valuable Professional on at

    @Phineas ,

    Assuming Subscriber_Status is a Text column, you need

    CountRows(
     Filter(
     Lucerna_Client_Collection,
     Radio2.Selected.Value <> "ACTIVE" ||
     Subscriber_Status = "ACTIVE"
     )
    )

    If it is a Choice column use Subscriber_Status.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

     

  • Phineas Profile Picture
    5,331 Moderator on at

    Thank you, Warren.

    A tweak, if I may...

    If the Radio is blank show all in gallery and give count of all in gallery,
    If Radio is 'ACTIVE' show only 'ACTIVE' and give count of only 'ACTIVE',
    If radio is 'CML DIGITAL' show only 'CML DIGITAL and give count of only 'CML DIGITAL'

    I've got the filter 'show' in gallery part working, I just need the label to reflect each of the counts.
    CountRows(
    Filter(
    Client_Collection,
    Radio2.Selected.Value = "ACTIVE" &&
    Subscriber_Status = "ACTIVE"
    ||
    CountRows(
    Filter(
    Client_Collection,
    Radio2.Selected.Value = "CML DIGITAL" &&
    Subscriber_Status = "CML DIGITAL"
    ))))

  • Verified answer
    WarrenBelz Profile Picture
    155,224 Most Valuable Professional on at

    @Phineas ,

    Something like this should do it

    CountRows(
     Filter(
     Client_Collection,
     Radio2.Selected.Value = Blank() ||
     Subscriber_Status = Radio2.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

  • Phineas Profile Picture
    5,331 Moderator on at

    Got the following to work. Thanks!

    CountRows(
               Filter(
                       Client_Collection,
                       Radio2.Selected.Value = Blank() ||
                       Radio2.Selected.Value = Subscriber_Status
    )
    )

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard