Forum Discussion
Sum from related table
I am trying to sum values that are on other tables onto a master table, but I can't seem to get it to work. It is essentially a Sumif function, but I can't seem to get Calculate and or SUMX to work. It always wants to return the fee for the entire related table (Revenue or Time).
Please see the below image. I am trying to sum Fees and Hours onto the Assignments table for the individual assignments. The Revenue and Time tables are linked to Assignments.
- Anonymous9 years ago
Try:
AssignmentTable[Total Fee] = CALCULATE(SUM(Revenue[Fee]))
The calculate is weird and required.
11 Replies
- AnonymousNot applicable
Your "What is Happening" is confusing on the Assignment table -- I assume there are actually 3 rows there?
- cdfisher89Frequent Visitor
Sorry. It isn't summing up at the relevant rows. It is just giving me a total for all assignments. I would like the total fees and hours for each assignment based on the other tables.
- cdfisher89Frequent Visitor
You can disregard the bottom half. I am just trying to create the Fee and Hours columns in the Assignment Table
- Dan80
Helper II
Best to use power query/query editor then bring the data through in one table.
Start with 'group by' function which is basically a sumif and do this for both the revenue table and the time table. This will produce one summed up value for each assignment. Then merge the time table into the revenue table, linking them by the assignment, select the hours colum to bring through to the revenue table. This will produce what you need 3 rows and 2 columns of data. Boom!