cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

IF, CountRows, Distinct using Sharepoint List.

Hello, 

 

Can someone help me out here?

 

I'm creating a label for a count of employees per supervisor. If the supervisor has 3 employees, I want the label to read "/3", if the supervisor has 2 employees, label should read "/2", etc.

 

Supervisor_Employee_Table: 

 

supervisor_num        employee_num

----------------   |   ----------------

123                    XYZ

123                    ABC

123                    JKL

890                    DEF

890                    GHI

 

Function: 

If(
    CountRows(
        Distinct(
        Supervisor_Employee_Table,
        employee_num)) <= 2,
"/2","/3")

 

Thanks for the insights. 

1 REPLY 1
Community Support Team
Community Support Team

Re: IF, CountRows, Distinct using Sharepoint List.

How would you like the supervisor to be selected?

If you would like to show the Employee for the same Supervisor within a gallery, then the formula for the Value Label should be:

 

If(
    CountRows(
        Distinct(
        filter(Supervisor_Employee_Table, supervisor_num=thisitem.supervisor_num),
        employee_num)) <= 2,
"/2","/3")

 

Regards,

Michael

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.