cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Sumproduct equivalent?

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? Smiley Very Happy

 

Many thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Sumproduct equivalent?

You can do something like this:

Sum(Filter(Tickets, AssignTo = "Hulk"), EstimatedHours)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Highlighted
Community Support
Community Support

Re: Sumproduct equivalent?

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,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: Sumproduct equivalent?

You can do something like this:

Sum(Filter(Tickets, AssignTo = "Hulk"), EstimatedHours)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Highlighted
Frequent Visitor

Re: Sumproduct equivalent?

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?

Highlighted
Community Support
Community Support

Re: Sumproduct equivalent?

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,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Sumproduct equivalent?

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".

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,180)