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 / 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

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