Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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.

  • Verified answer
    CU12090750-0 Profile Picture
    on at
    Re: Count rows that contain "A", "B" or "C" as value

    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")

  • vikas1606 Profile Picture
    206 on at
    Re: Count rows that contain "A", "B" or "C" as value

    @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
    )
    )

  • CU12090750-0 Profile Picture
    on at
    Re: Count rows that contain "A", "B" or "C" as value

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

  • CU12090750-0 Profile Picture
    on at
    Re: Count rows that contain "A", "B" or "C" as value

    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.

  • vikas1606 Profile Picture
    206 on at
    Re: Count rows that contain "A", "B" or "C" as value

    hi @ErikKjellman 

    Can you try the below statement?

     

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

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on at
    Re: Count rows that contain "A", "B" or "C" as value

    Hi @ErikKjellman ,

     

    You can try the following code:

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

     

    Hope this helps

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,594 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard