cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stepzaza09
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 

PENDING > APPROVED or REJECTED

 

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

stepzaza09_1-1649321634902.png

stepzaza09_2-1649321652238.png

stepzaza09_3-1649321843567.png

 

 

 

0 REPLIES 0

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,244)