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.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 286 members 4,722 guests
Please welcome our newest community members: