Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Get sum by condition and compare with value from another list

Hello everyone 

What i'm going to do is create a tracking budget project application by using SharePoint list as a database

the concept is once when the user is every time the user creates form from an application (power app) the expense status need to be approved by their manager and then to finance again


to be clear the status of the expense will be 



my problem is once when the user add an expense over budget many time when budget is nearly over and approver didn't recognize that the expense will be over budget it will be BUG


for example

the budget for project is 500$ and sum of expense is 480$ this mean budget for project still remain 20$ which mean user can add expense like 10$ two times or whatever amount of expense total is 20$ (PENDING STATUS) it would be fine if the approver approves the expense but this means user also can 10$ three times and if approver approve all of them (Budget will be over to 510$) which it's not make sense


so my solution is after approver approve it i need power automate to sum all expense that has been approved of the selected project to check that is over budget or not, this mean i want to get sum by multiple condition and then use the value of sum to compare value from another list


i've tried to use Get Item but i can't find an example of syntax to filter column by multiple conditions


in power app the filter code it should look like this


Sum(Filter(Expense,'Project Name'.Value = 'Project Name'.Value && 'Expense Status'.Value = "Approved"),'Expense Amount'


here is my List and flow








Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (6,584)