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 currency column fr...
Power Apps
Unanswered

Sum currency column from SharePoint List based on date range

(0) ShareShare
ReportReport
Posted on by 40

Hello,

I have been trying different formulas without success if I want to Filter by a date range. The Sum function with my currency field without date as a criteria works fine even though I get the delegation warning.

I looked around the forum and tried a few things but no sucess.

 

My Goal: Sum up the 'Amount' column from my List called 'MaintenanceExpenses' for a specified date range based on 'ExpenseDatePickerFrom' and 'ExpenseDatePickerTo'. The date picker compare the date with my 'Created' column.

 

I have a SharePoint List with a column 'Amount' that is of Currency type.

1.png

My App and formula:

2.png

 

 

 

Text(Sum(Filter(MaintenanceExpenses,Value(Text(Created,"[$-en-US]mm/dd/yyyy")) >= ExpenseDatePickerFrom.SelectedDate,Value(Text(Created,"[$-en-US]mm/dd/yyyy")) <= ExpenseDatePickerTo.SelectedDate),Amount),"[$-en-US]$#,###0.00")

 

 

Most likely I'm making a very basic mistake. Any suggestion would be amazing!

 

Thanks!

 

 

Categories:
I have the same question (0)
  • Verified answer
    PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Can you replace the filter criteria with something like this?

    DateDiff(ExpenseDatePickerFrom.SelectedDate, Created)>0, DateDiff(Created, ExpenseDatePickerTo.SelectedDate)>0

    Let me know if this helps. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

     

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi there

    as date field cant be delegated, an idea is to have a column in your SharePoint list date_serial or something that is the number equivalent of your date.

    assign the result to a variable gblMaintExpense

    Sum(

    filter(source,

    date_serial >= value(datepickerStart.selecteddate) &&

    date_serial<= value(datepickerEnd.selecteddate)     

    ),

    Amount

    )

    set the label text to

    Text(gblMaintExpense,"#$00,00.00")
  • statuko Profile Picture
    40 on at

    Thanks for replying @PowerAddict !

    No success using this instead of Filter.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Just to confirm, this was supposed to simply replace the filter criteria you had in your filter. You would still need the Filter function. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • statuko Profile Picture
    40 on at

    Thanks for the reply @rubin_boer!

    And I assume to feed that new column I have to get that done when I add a new entry?

    I have never dealt with number equivalent of date. I will look that up.

  • statuko Profile Picture
    40 on at

    @PowerAddict yes. So it looks like this:

    Text(Sum(Filter(MaintenanceExpenses,DateDiff(ExpenseDatePickerFrom.SelectedDate, Created)>0, DateDiff(Created, ExpenseDatePickerTo.SelectedDate)>0,Amount),"[$-en-US]$#,###0.00")
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Sounds good. Thank you for replying and trying it out. I will test it on my side and suggest something if the approach suggested by @rubin_boer doesn't work. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • statuko Profile Picture
    40 on at

    @PowerAddict,

    Actually it worked. It was my mistake. I had made a mistake with the syntax. 

    Text(Sum(Filter(MaintenanceExpenses,DateDiff(ExpenseDatePickerFrom.SelectedDate, Created)>0, DateDiff(Created, ExpenseDatePickerTo.SelectedDate)>0),Amount),"[$-en-US]$#,###0.00")

     

    Now I just need to tweak it so that it includes today's amounts. The Sum returned doesn't account for the entries done on the To date.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Glad I could help! Good luck with the rest of the app! Feel free to reach out in case of any questions!

     

    You probably just need to change the To date condition to >=0 rather than >0.

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    yes you got it. glad to see you sorted the filter. good luck with the app, have fun.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard