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 of rows in Datatable
Power Apps
Unanswered

Sum of rows in Datatable

(0) ShareShare
ReportReport
Posted on by 39

Hi Team,

sum of rows based on same column in between 2 dates

 

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @Jyothi1 

     

    Try this,

     

    Sum(
     Filter(
     YourDataSource, 
     YourDateColumn >= StartDate && YourDateColumn <= EndDate
     ), 
     YourColumnToSum
    )

     

     

    Refer this thread : Solved: Sum all values between two dates - Power Platform Community (microsoft.com)

     

     

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • Jonathan Manrique Profile Picture
    2,687 on at

    Hi @Jyothi1 

     

    You can use this condition to establish the range of products and the right amount

     

    Sum(Filter(date < DateColumn and date >DateColumn2),Amount) 

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    You can accept more than one post as a solution

  • Jyothi1 Profile Picture
    39 on at

    Thanks for the quick response but it didnt work. Ok I will explain my problem. I have 2 date pickers.  I should calculate the total amount of milk given by one animal of that particular animal Tag number. Here I have to use Tag number as the reference.

  • FazalUrrehman Profile Picture
    131 on at

    Can u provide with the column names along with screenshots which will help us to understand better

  • Jyothi1 Profile Picture
    39 on at
  • FazalUrrehman Profile Picture
    131 on at

    Ok Try This

    On Visible

    ClearCollect(Collection1, Distinct( DatasourceName, TagId ));

    On Change of any of the datepickers

    Clear(Collection2);
    ForAll(Collection1,
    Collect(Collection2,
    {
    TagID : Value,
    Milk : Text(Sum(Filter(Datasource,TagID=Value && DateColumn > Datepicke1.SelectedDate && DataColumn <DatePicker2.SelectedDate ),Milk))
    }
    );

     Try this and let me know if there is any issue in the code

  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @Jyothi1 

     

    Assuming your data source is named MilkData, your date column is named Date, your milk amount column is named MilkAmount, and your tag number column is named TagNumber.

     

    Sum(
    Filter(
    MilkData,
    Date >= DatePicker1.SelectedDate && Date <= DatePicker2.SelectedDate && TagNumber = "YourAnimalTagNumber"
    ),
    MilkAmount
    )

     

     

    Thanks!

  • Jyothi1 Profile Picture
    39 on at

    Hi,

    Still getting error. 

  • FazalUrrehman Profile Picture
    131 on at

    U have missed two brackets at the end before the closing curly bracket

     

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard