Hello,
I have an app to organise workload which is based on jobs, where each job is a row of data on an excel table called "Tickets" (please see Tickets.jpg attached).
On the app, I can assign each job to a list of employees, which is in another excel table (please see Heroes.jpg attached).
Thus, when the job is assigned to someone, the table "Tickets" will have the "assigned to" column value filled in with the employee name (which you choose from the list).
What I need is to summarise the number of hours that an employee has in total, for instance "Hulk" has 2 jobs of 1 and 3 hours, so 4 in total.
This is easily done in Excel with Sumproduct(), where you can even set filters if the job is already closed or if you want to add only "high priority".
But I have no clue how to get this done in Powerapps.
Would anybody be able to shed some light in the matter?
Many thanks!
Solved! Go to Solution.
You can do something like this:
Sum(Filter(Tickets, AssignTo = "Hulk"), EstimatedHours)
Hi @JuanFiscinaMend ,
Could you please share a bit more about the ItemsInEmployeeList that you mentioned? Is it the Excel table as your Heroes.jpg?
Do you want to calculate the toal hours for each Employee within your Tickets Table?
Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:
Add a Data Table control in your app, set the Items property to following:
ForAll( EmployeeListTable, /* <-- EmployeeListTable represents the Employees List Table mentioned in your Heroes.jpg */
{
EmployeeName: EmployeeListTable[@Name],
TotalHours: Sum(Filter(Tickets, AssignTo = EmployeeListTable[@Name]), EstimatedHours)
} )
enable the EmployeeName field and TotalHours field in your Data Table, then check if the issue is solved.
Best regarss,
You can do something like this:
Sum(Filter(Tickets, AssignTo = "Hulk"), EstimatedHours)
Hi Jeff,
Thanks for the reply.
Yes, that is along the lines of what I need.
I do need that to be done for every employee, and ideally not hard coding each individual name on the formula.
Result should be something like:
ForAll ( ItemsInEmployeeList, Sum ( Filter ( Tickets, AssignTo=ThisItem ), EstimatedHours ) )
Would this be a thing?
Hi @JuanFiscinaMend ,
Could you please share a bit more about the ItemsInEmployeeList that you mentioned? Is it the Excel table as your Heroes.jpg?
Do you want to calculate the toal hours for each Employee within your Tickets Table?
Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:
Add a Data Table control in your app, set the Items property to following:
ForAll( EmployeeListTable, /* <-- EmployeeListTable represents the Employees List Table mentioned in your Heroes.jpg */
{
EmployeeName: EmployeeListTable[@Name],
TotalHours: Sum(Filter(Tickets, AssignTo = EmployeeListTable[@Name]), EstimatedHours)
} )
enable the EmployeeName field and TotalHours field in your Data Table, then check if the issue is solved.
Best regarss,
Hello all,
Thanks for the answers.
I ended up finding a solution where I combined bits and pieces from what you guys suggested.
In short, I created a new column on my table "Heroes" with the total hours that a hero has assigned. Then, when you assign a job to this person, it calculates the amount of hours this person has.
The variable "editassign" is set when you click on a hero name to select it. Pressing save makes the call for the function below to update the record for said hero:
Patch( Heroes, First( Filter( Heroes, Name = editassign ) ), { TotalHours: (Sum( Filter( Tickets, AssignedTo = editassign && Status <> "Closed" ), EstimatedHours )), HighPriHours: (Sum( Filter( Tickets, AssignedTo = editassign && Status <> "Closed" && Priority = "High" ), EstimatedHours )) } )
As you can see from the code, it adds additional conditions like ignoring closed jobs and there is an additional column to highlight which of assigned hours are "high priority".
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
199 | |
97 | |
56 | |
51 | |
41 |
User | Count |
---|---|
266 | |
156 | |
83 | |
81 | |
56 |