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:
