cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Art_Ratta
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
ZabiBabar
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
eka24
Super User
Super User

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.

JayMagness
Solution Specialist
Solution Specialist

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)

ZabiBabar
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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,572)