web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / IF, CountRows, Distinc...
Power Apps
Unanswered

IF, CountRows, Distinct using Sharepoint List.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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. 

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    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

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard