Forum Discussion
Francisco77
Oct 28, 2023Copper Contributor
Formula to find number
Hi Community, I have this table that shows values by date. How could I generate a formula in which, indicating a start date, it shows me the date on which the accumulated sum of values reache...
Patrick2788
Nov 01, 2023Silver Contributor
I recommend tabling the source data to set yourself up with dynamic items and then do some accumulation:
=LET(
discard, XMATCH(DateInput, Table1[Date]) - 1,
Values, DROP(Table1[Value], discard),
Dates, DROP(Table1[Date], discard),
Accumulate, LAMBDA(a, v, a + v),
AccArray, SCAN(0, Values, Accumulate),
XLOOKUP(100, AccArray, Dates, "", -1)
)