Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Countrow of distinct item

Posted on by

Hello All,

 

How can i set up a count of employees that are distinct to the 'Job Title' and report to the reporting Manager? 

 

So i want a gallery with a list of distinct titles and the number of employees for that specific title. 

 

Example table below: 

Admin 1

Manager 2
Sales Rep 2

 

I currently have a variable set as mgrVar= Thisitem.Employee that needs to be incorporated into the formula. It is a onselect variable. Not sure if this matter, but not all reporting will have the same type of job title employee. Some managers will have Specialist, supervisor, etc. That is the why I want it dynamically show whomever is selected their respective employee title and employee count will appear.

 

EmployeeJob TitleReporting Manager

Pluto

AdminBugs

Mickey

ManagerBugs
MinnieManagerBugs
DonaldSales RepBugs
GoofySales RepBugs

 

Thank you

Categories:
  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Countrow of distinct item

    it's not listing the manager's employee. it is listing the entire SP list and total. I need to incorporate this variable in the formula so that when an employee is selected only the result for the employee will populate

     

    mgrVar= Thisitem.Employee

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Countrow of distinct item

    @punksterz626

    That sounds like a different question. 

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Countrow of distinct item

    A datacard in the form. I found a workaround. It the form the Datafield listed it as "field_2" and it worked when i try using that. 

     

    Now, how do I combine these two syntax in the gallery? Right now its listing all the Job Title in the SP list and the total numbers. The filter is used when a certain employee is selected.

     

    Filter('Org Chart',Employee =Gallery3_1.Selected.Employee)

    GroupBy('Org Chart',"field_2", "Data")

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Countrow of distinct item

    @punksterz626 

    Is anything else showing up that looks close?  Maybe you repurposed the Title column?

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Countrow of distinct item

    For some reason intellisense is not recognizing the 'Job Title' name

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Countrow of distinct item

    @punksterz626

    GroupBy not Groupby 

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Countrow of distinct item

    its not accepting the groupby function.

     

    So on the blank gallery Item property i have the following syntax Groupby('Org Chart', "Job Title", "Data")

     

    Org Chart is the source (sharepoint List). Did i do something wrong here? 

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Countrow of distinct item

    @punksterz626 

    You could even show them with names by putting a listbox in the gallery with the Items property ThisItem.DATA.

    !.jpg

     

  • Verified answer
    Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Countrow of distinct item

    @punksterz626 

    For your table above, as the Items property of a gallery:

    GroupBy(Table,"Job Title","DATA")

    Put two labels in the gallery, One with Text property ThisItem.'Job Title" and the other with CountRows(ThisItem.Data)

    Using your data:

    !!.jpg

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard