Calculate between 2 different tables.

Hi there, 

I have 2 tables, tableA is the money I received from project123, tableB is the money I paid to the suppliers of project123. I would like to know the profit of each project, how to set the formula?

I may receive/pay the money of project123 for more than 1 time, so I will have to SUM the values of project123 in tableA/tableB first, and do the calculation.   

Solved Solved
0 4 404
1 ACCEPTED SOLUTION

I believe it more sensible to have a separate project table to place this expression in.

But I see no reason that you cannot technically put this in Table A (or B). You will have multiple data of the same value though.

 

View solution in original post

4 REPLIES 4

SUM(
 SELECT(tableA[money received], [project] = [_THISRROW].[project])
 - 
 SELECT(tableB[money paid], [project] = [_THISRROW].[project])
)

Assuming this formula is placed at yet another table (ie pojects) which both Tables A and B refer to via its key field [project].

Hi TeeSee1, 

Thanks a lot for your reply. 

Is it possible that I place this formula in Tables A?

I believe it more sensible to have a separate project table to place this expression in.

But I see no reason that you cannot technically put this in Table A (or B). You will have multiple data of the same value though.

 

I put this formula in TableA and it works. 

Thank you TeeSee1. ๐Ÿ˜€

Top Labels in this Space