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
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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,373)