How to lookup and tally various rows

Hello,

I have a Timesheet App that allows employees to punch in and reference and ongoing project (Work Order).

On my Work Order table each work order has a column that has total hours.

I would like to have that column look up all the work orders timesheets from this row and do a tally on the total amount of hours spent on the project.

I tried this but it will not work. Any ideas?
SUM(
LOOKUP([_THISROW].[WorkorderID], “Timesheet”,“WorkorderID”,"Total Hours"
))

TIA

Try:

SUM(
SELECT(Timesheet[Total Hours], ([_THISROW].[WorkorderID] = [WorkorderID])
))
1 Like