I am having a problem trying to find a sumif funtion for PowerBi. I have two tables a labor and a budget. My labor has the following columns:
Section Amount invoice
1.a $10 1
1.b $11 1
1.c $12 1
1.a $22 2
1.d $100 2
1.q $50 2
1.c $1 3
and my budget table looks like as follows:
Section Budget-Amount
1.a $100
1.b $200
1.c $250
1.d $150
1.q $90
.
.
.
What I want to do is add another column to the budget table names Budget remaining. What this would do is add all the amounts that pertains to the section on the current row from labor and subtract that from Budget amount.
I've looked up examples on how to do this but it appears that there are only examples when using the same table. But I also keep reading that the calculate function is more powerful than sumif.
I've tried to use the calculate funtion as follows:
Remaining Budget = ('Budget'[Budget Amount])- CALCULATE(SUM('Labor'[Amount]),'Labor'[Section]='Budget Labor'[Section])
the error that i get is "The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression."
I'm sorry if this is a dumb question, I just cannot seem to find the right answer online.
Thank you in advance.