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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / 'Sum' function filter
Power Apps
Unanswered

'Sum' function filter

(1) ShareShare
ReportReport
Posted on by 153

Hi guys!

 

I want to know how many minutes there are inserted in one day for worker, my app insert the jobs in excel like this.

 

Captura.JPG

 

In one screen i have "Gallery" with this function Filter(Tabla1;Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text) that shows the daily jobs for the selected worker.

Captura2.JPG

 

Now I want to have a field that sums all the results from the selected date and worker. Or the sum of all body fields in the gallery. How can i make a sum from the excel with the filter "Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text"

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    To accomplish this, you can creat a label, and then set the Text property to Sum(Gallery1.AllItems,Minutos) where Gallery1 is the name of the gallery and Minutos is the field to sum.

     

    I hope that helps!

  • Verified answer
    CarlosFigueira Profile Picture
    on at

    You can pass the filtered table as the first argument to the Sum function:

    Sum(
     Filter(Tabla1;Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text);
     Minutos)
  • SanchezITM Profile Picture
    153 on at

    Thank you @CarlosFigueira works perfect. in addition, can I show this number in time format? 150 = 1h 30m 0s

  • CarlosFigueira Profile Picture
    on at

    Yes, you can use the formula multiple times (PowerApps currently doesn't have the concept of a "macro" where you would use it in place of the repeated text):

    RoundDown(Sum(Filter(Tabla1;Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text); Minutos) / 60; 0) & "h " &
    RoundDown(Mod(Sum(Filter(Tabla1;Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text); Minutos); 60); 0) & "m " &
    RoundDown(Mod(Sum(Filter(Tabla1;Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text); Minutos) * 60; 60); 0) & "s"

    The first line will divide that result by 60 (to get the number of hours), then round it down (i.e., trim the fractional part); the second line will get the remainder (via the Mod function) of the total number of minutes and 60 (i.e., removing the number of whole hours). Finally, the last line will multiply the number of minutes by 60, so that if you had any fractional part (seconds) we'll retrieve them.

  • Monte Profile Picture
    Microsoft Employee on at

    This helped me.  Thank you.  Note that I discovered it works if I change the semi-colon to a comma after the Filter statement like this:

    Sum( Filter(Tabla1;Fecha = TextBox2.Text; Nombre = TecnicoCSG_1.Text), Minutos)

     

  • Community Power Platform Member Profile Picture
    on at

    Hey guys, I have a similar problem.

    I have a collection called "Myresults" with 1 Collum called "Results". Strings are put into them.

     

    I want to count all rows / elements that have the same string.
    Like:
    1. Alex = 22 times
    2. Bob = 11 times

    3. ...

     

    The names are changing every time so I have to get it from an element.

     

    I tried it with:

     

    Sum(
    Filter(
    Myresults;
    Result = Radio2_1.Selected.Value;
    );
    Result
    )

     

    This does not work 😕 can someone help?

    Thank you very much!

  • Zi Profile Picture
    4 on at

    Sum(Filter(conditions), value) returns "Part of this formula cannot be evaluated remotely. 'Sum' operation is not supported by this connector/service. 

    Does anybody have it worked? 

    Please help!!!

    Thank you very much!

  • testasdfasfsafa Profile Picture
    309 on at

    This answer should be promoted to the accepted solutions.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard