cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

CountIF with multi condition on gallery

Dear Community

I need to create label inside gallery for count rows in SPList Details from attached.

 

please. 

1 ACCEPTED SOLUTION

Accepted Solutions
Continued Contributor
Continued Contributor

Hi @Art_Ratta , 

This formula is not working because CountIf only returns the count of rows that return true for all of the conditions.

CountIf('SPList2', Course_No = DropdownListCourseNo.Selected.Text , status = "Register", Site=ThisItem.Target_Group , JobTitle = ThisItem.Target_Group , Department = ThisItem.Target_Group)

This formula would not return true will always return 0 because the last 3 conditions can not all be true. You only either have site, jobTitle or deparment as the target_group.

 

Instead try this!

CountIf('SPList2', Course_No = DropdownListCourseNo.Selected.Text && status = "Register" && (Site=ThisItem.Target_Group || JobTitle = ThisItem.Target_Group || Department = ThisItem.Target_Group))

 

With this it will return true if one of the three columns (site, job title, and department) match the target group, and will add it to the total count. 

 

Hopefully this works. 

 

Best,
Zabi
Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than one answers as solutions, including your own answer. 🙂

View solution in original post

7 REPLIES 7
Super User III
Super User III

Can you copy and paste the formula?

Also is the first formula with multiple criteria working

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Super User
Super User

Hi,

 

I have done this a lot, here is an example using Sum to get to Dollars in each section of a gallery filtering off the GUID I crate

 

"Prop: "&Text(Sum(Filter(ServiceExpences,OPGUID=Label2_30.Text),CustEsttoCus),"[$-En-US]$#,###")

 

If you want we can get on a teams meeting and I can try to help you directly, email me at jay@research-nest.com

 

Jay

@eka24  the first formula working with only one condition only .

I suggested you put the text copy of the Formulas in your reply instead of the picture

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

formula it's working

CountIf('SPList2', Course_No = DropdownListCourseNo.Selected.Text , status = "Register", Site=ThisItem.Target_Group)

 

and it's not working

CountIf('SPList2', Course_No = DropdownListCourseNo.Selected.Text , status = "Register", Site=ThisItem.Target_Group , JobTitle = ThisItem.Target_Group , Department = ThisItem.Target_Group)

Continued Contributor
Continued Contributor

Hi @Art_Ratta , 

This formula is not working because CountIf only returns the count of rows that return true for all of the conditions.

CountIf('SPList2', Course_No = DropdownListCourseNo.Selected.Text , status = "Register", Site=ThisItem.Target_Group , JobTitle = ThisItem.Target_Group , Department = ThisItem.Target_Group)

This formula would not return true will always return 0 because the last 3 conditions can not all be true. You only either have site, jobTitle or deparment as the target_group.

 

Instead try this!

CountIf('SPList2', Course_No = DropdownListCourseNo.Selected.Text && status = "Register" && (Site=ThisItem.Target_Group || JobTitle = ThisItem.Target_Group || Department = ThisItem.Target_Group))

 

With this it will return true if one of the three columns (site, job title, and department) match the target group, and will add it to the total count. 

 

Hopefully this works. 

 

Best,
Zabi
Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than one answers as solutions, including your own answer. 🙂

View solution in original post

@ZabiBabar  thank you so much.

it's working Very well. 

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (94,594)