cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

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