cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Sum currency column from SharePoint List based on date range

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Sum currency column from SharePoint List based on date range

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

 

View solution in original post

12 REPLIES 12
Highlighted
Super User II
Super User II

Re: Sum currency column from SharePoint List based on date range

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

 

View solution in original post

Highlighted
Resolver III
Resolver III

Re: Sum currency column from SharePoint List based on date range

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")
Highlighted
Helper I
Helper I

Re: Sum currency column from SharePoint List based on date range

Thanks for replying @PowerAddict !

No success using this instead of Filter.

Highlighted
Super User II
Super User II

Re: Sum currency column from SharePoint List based on date range

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

Highlighted
Helper I
Helper I

Re: Sum currency column from SharePoint List based on date range

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.

Highlighted
Helper I
Helper I

Re: Sum currency column from SharePoint List based on date range

@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")
Highlighted
Super User II
Super User II

Re: Sum currency column from SharePoint List based on date range

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

Highlighted
Helper I
Helper I

Re: Sum currency column from SharePoint List based on date range

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

Highlighted
Super User II
Super User II

Re: Sum currency column from SharePoint List based on date range

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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