Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

CountRows with Filter on multiple columns

(0) ShareShare
ReportReport
Posted on by 85

Hello,

 

I'm trying to combine multiple conditions to the CountRows:

 

CountRows(Filter('Source'; Column1 = Concat(varSelected; Nadpis) && 'Column2' = startTime))

 

 

I need to get back number of rows that fulfill the two(three, four) conditions. If I do one condition at a time, it works fine but it doesn't work when I start adding criteria.

 

What is the proper syntax?

 

Thank you

  • charlessexton Profile Picture
    878 on at
    Re: CountRows with Filter on multiple columns

    Have you looked at the output from Column2 and startTime1 to make sure they're the same as each other? They will need to be the same type and format in order to match. They have to be exactly the same.

  • JanDras Profile Picture
    85 on at
    Re: CountRows with Filter on multiple columns

     

    Source:

    Column1Column2Column3
    Name1StartTime1EndTime1
    Name2StartTime2EndTime2

     

    I am trying to create an if() condition that would prevent the users creating a duplicate entry.

     

    If I use:

    CountRows(Filter(Source; Column1 = Name1))

    The output is 1 (and it's right.

    but once I use:

     

    CountRows(Filter(Source; Column1 = Name1 && Column2 = startTime1))

     

    The output is 0 but the row that matches the conditions exist.

  • charlessexton Profile Picture
    878 on at
    Re: CountRows with Filter on multiple columns

    When you say that it doesn't work, in what way doesn't it work? CountRows gives you an error? CountRows states there are zero items?

  • JanDras Profile Picture
    85 on at
    Re: CountRows with Filter on multiple columns

    Yes, I renamed it just for the sake of the post, in the original the column names do have spaces.

  • charlessexton Profile Picture
    878 on at
    Re: CountRows with Filter on multiple columns

    You don't need to have apostrophes on your column name unless there are spaces in it. So 'Column2' should be Column2.

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,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard