I just started converting an excel document with multiple tables into a PowerApp to make it easier to add costs. I have two main tables: Log and Budgets.
The Log table has columns like Date, Job, Cost Type, and Total $. I have another table called Budgets that has the Job, Labor Budget, Labor Actual, and Labor Budget Spent (Also columns for other budgets but I can repeat the process on the other budgets). Here's a sample of what the tables look like.
Log
| Date | Job | Cost Type | Total $ |
5/10/2021 | Job A | 1 Labor | $500 |
| 5/11/2021 | Job B | 1 Labor | $750 |
| 5/12/2021 | Job A | 2 Overtime Labor | $100 |
Budgets
| Job | Labor Budget | Labor Actual | Labor Budget Spent |
| Job A | $1000 | $600 | 60% |
| Job B | $750 | $750 | 100% |
Now I have the log setup where you select the Job from a list of active jobs, and the cost types from a cost type list, and the Total $ is entered.
The Budgets page already has all the Jobs that need to be on there, the Labor Budget is manually entered, but the Labor Actual should be doing something like a SUMIF in excel to get that value of $600 for Job A.
This is the formula I have in the Datacardvalue for Labor Actual in the form for editing a row in the Budgets table.
Job (From Budgets table) = Datacardvalue18
Sum(Filter(Log, Job=DataCardValue18.Selected.Job_x0020_Name,Or('Cost Type'="1 Labor", 'Cost Type'="2 Overtime Labor")),'Total $')
This formula works perfectly fine, but it only updates the Budgets table if the form is submitted. What I need to know is how can I build this so the Budgets tab updates as soon as a cost is added. For example, if I were to add a cost to Job A, 1 Labor, for $500. I would want Job A in the Budgets tab to immediately have Labor Actual of $1100. Instead, I would have to edit the Budgets form of Job A, submit the form, and then it would update to $1100.
Is there anyway to do this?