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 rows that contai...
Power Apps
Answered

Count rows that contain "A", "B" or "C" as value

(0) ShareShare
ReportReport
Posted on by

I have a dataset that looks like this:

IDPropertyStatus
1redA
2blueA
3yellowB
4redC
5blueD
6yellowD

I want to count the number of rows that contains either A, B or C and show that count in my app.

CountIf(dataset; Status = "A" || Status = "B" || Status = "C")

I have tried this and a number of variations, but nothing works. This formula tells me CountIf is not supported by this connection.

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @ErikKjellman ,

     

    You can try the following code:

    CountRows(
     <DataSource>,
     Status = "A" || Status = "B" || Status = "C"
    )

     

    Hope this helps

  • vikas1606 Profile Picture
    206 on at

    hi @ErikKjellman 

    Can you try the below statement?

     

    CountRows(Filter(MyDataset, MyColumn = "A" || MyColumn = "B" || MyColumn = "C"))

  • CU12090750-0 Profile Picture
    on at

    Forgot to mention that my dataset is a sharpoint list. I get an error saying it expects 1 argument, not two. If I remove the second argument it counts my rows, but I need them filtered.

  • CU12090750-0 Profile Picture
    on at

    It is the same problem, it says that this connection does not support CountRows

  • vikas1606 Profile Picture
    206 on at

    @ErikKjellman , If CountIf and CountRows not working then could you try the Sum function as mentioned below?

     

    Sum(
    dataset,
    If(
    Status = "A" || Status = "B" || Status = "C",
    1,
    0
    )
    )

  • Verified answer
    CU12090750-0 Profile Picture
    on at

    So it turned out that the problem was related to the fact that the column was a text type. I changed it to a Choice type, and added .Value to my data column, like so:

    CountIf(Dataset; Status.Value = "A" || Status.Value = "B" || Status.Value = "C")

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard