cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

CountIf User is Admin or One of the other users

So based on help I have received over the past couple of days I wanted to have a numerical display to make it easy for my users to see how many items at each status they have logged to their name. I have written the following code based on how I filter my data in my gallery.

So what I believe should work, doesn't and in my head I am saying/reading the code I have written as:
If my user is in the Admin SharePoint list then count how many Not Started, In Progress, Dead Deal, Completed Deal entries are there total for ALL USERS and Total them up. Else if they are not a user in the Admin SharePoint list then count how many of each status they are listed on either as the Assigned To user or a Lead Member user ONLY.

If(!IsEmpty(Filter(Admin_LeadData,FullName=varUser)),
       CountIf(Lead_Data, Status.Value = "Not Started") & Char(10) &
       CountIf(Lead_Data, Status.Value = "In Progress") & Char(10) &
       CountIf(Lead_Data, Status.Value = "Dead Deal") & Char(10) &
       CountIf(Lead_Data, Status.Value = "Completed Deal") & Char(10) &
       Sum(colDash_StatusTrack, Count),
     Filter(Lead_Data, AssignedTo.Value = varUser || LeadMember1.Value = varUser || LeadMember2.Value = varUser || LeadMember3.Value = varUser || LeadMember4.Value = varUser));

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: CountIf User is Admin or One of the other users

@KimberlyM 

Hi there Kim.  I was wondering if you had considered using the GroupBy function.  It sounds like it would be a great fit for your case.  GroupBy could SUM the results set of Filter(Admin_LeadData,FullName=varUser) by status.  There are some examples in the PowerApps documentation under "Aggregate results".

 

I tried to find a video that was directly applicable to your siutation but could not.  However, I feel Audrie Gordon's video gives a good general intro https://www.youtube.com/watch?v=70tEP0ZAmsM

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

 

 

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: CountIf User is Admin or One of the other users

@KimberlyM 

Hi there Kim.  I was wondering if you had considered using the GroupBy function.  It sounds like it would be a great fit for your case.  GroupBy could SUM the results set of Filter(Admin_LeadData,FullName=varUser) by status.  There are some examples in the PowerApps documentation under "Aggregate results".

 

I tried to find a video that was directly applicable to your siutation but could not.  However, I feel Audrie Gordon's video gives a good general intro https://www.youtube.com/watch?v=70tEP0ZAmsM

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

 

 

View solution in original post

Highlighted
Helper IV
Helper IV

Re: CountIf User is Admin or One of the other users

Thank you. I am looking into this to see how it will best work for me with what I have done already. 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,237)