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

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (19,341)