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 Apps
Answered

Custom line chart

(0) ShareShare
ReportReport
Posted on by 77

Hello, I have two Sharepoint Lists: Advisers and Advisees.

 

How can I count the total Advisees each Adviser has,  the total Advisees per department, and show the percentage of advisee's Career Level per Adviser. In the Advisee's list, I have LookUp columns to other 2 lists with Department and Career Levels. The Advisees and Adviser's names are person columns.

 

Any help would be appreciated.

 

Screenshot 2022-03-22 202400.png

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Not seeing your datasource layout we can only guess, but I would guess groupby would be in order

  • lauratn Profile Picture
    77 on at

    Name and Adviser are Person columns, Career Level and Department are LookUp columns

    Screenshot 2022-03-22 221323.png

    Name is a person column, Advisee is person multi-select, PID and Total Advisees are type number

    Screenshot 2022-03-22 221429.png

  • Verified answer
    lauratn Profile Picture
    77 on at

    The solution was:

    Creating a collection using a SharePoint list:

     

    ClearCollect(
     colCareerLevel,
     careerLevelList
    );

     

    Creating a collection using Office365.DirectReportsV2 function:

     

    ClearCollect(
     colDirectReport,
     AddColumns(
     Office365Users.DirectReportsV2(AdvisersGallery.Selected.Name.Email).value,
     "CareerLevel",
     LookUp(
     colCareerLevel,
     OfficeTitle = If(
     "," in jobTitle,
     First(
     Split(
     jobTitle,
     ","
     )
     ).Result
     )
     )
     )
    );

     

    Getting the total Advisees for Each Adviser:

     

    CountRows(Filter(
     colDirectReport,
     accountEnabled = true
    ))

     

    Creating a Blank Vertical Gallery and inserting two rectangles. One for the background, one for the foreground.

    In my LineChartGallery.Items:

     

    Filter(
     ForAll(
     Distinct(
     colDirectReport,
     CareerLevel.Title
     ),
     {
     Result: Result,
     Percentage: CountRows(
     Filter(
     colDirectReport,
     department = cb_Departments.Selected.Result || IsBlank(cb_Departments.Selected.Result),
     CareerLevel.Title = Result
     )
     ) / CountRows(
     Filter(
     colDirectReport,
     department = cb_Departments.Selected.Result || IsBlank(cb_Departments.Selected.Result)
     )
     )
     }
     ),
     Percentage <> 0
    )

     

    In background rectangle width: 500

    In my Foreground rectangle's width property:

     

    rectBackground.Width * ThisItem.Percentage

     

     In my lable showing the percentage:

     

    Text(ThisItem.Percentage*100, "#.0%")

     

    The result was a line chart that I could select by department with a Combobox:

    Screenshot 2022-04-08 153257.png

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Great job, sorry I didn't get back to you, somehow missed your response

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard