Display rows until aggregate value reached

I have a timesheet table where contractors enter their time and submit invoices to be paid. I have an invoice table where these payments are made to a contractor.

A contractor table has a VC that calculates the owed value from their submitted timesheets, this value is negative (for over-paid) or positive (yet to be cashed out).
I have an action for contractors that lists the timesheets before the last payment date.
(linktofilteredview(โ€œTimesheetโ€,and([Contractor]=[_THISROW].[Contractor],[Date]>[_THISROW].[PaymentDate])))
I want to change this action to list the rows from timesheet that sum to the owed value.
How do I create an expression that aggregates a value for comparison:
linktofilteredview(โ€œTimesheetโ€,and([Contractor]=[_THISROW].[Contractor],SumOfRows([Invoice])<[Paid]))
Where SumOfRows() adds the column of the matching row to the previous matched rows.
How would the match be sorted or reversed (ascend, descend).

0 1 257
1 REPLY 1

Steve
Platinum 4
Platinum 4

I canโ€™t think of a way to do this that isnโ€™t absurdly complicated. I wonder if there might be a better way to accomplish your goal. Why do you want to display rows until aggregate value reached?

Top Labels in this Space