Forum Discussion
tw1211
Oct 31, 2023Copper Contributor
Remodel a table by calculating time difference
Hello, I have table 1 with Xvalue+ date when collected and table 2 with various Yvalues + date when been collected. I want to get a third table with a list of all single dates (+ Yv...
OliverScheurich
Oct 31, 2023Gold Contributor
=DROP(REDUCE(Table_1[#Headers],SEQUENCE(ROWS(Table_1[date])),LAMBDA(x,y,
LET(z,WRAPROWS(CHOOSEROWS(Table_2[[date]:[Y4]],y),2),
LET(z,WRAPROWS(CHOOSEROWS(Table_2[[date]:[Y4]],y),2),
u,BYROW(CHOOSECOLS(z,1),LAMBDA(r,ABS(INDEX(Table_1[date],y)-r))),
VSTACK(x,HSTACK(y,XLOOKUP(MIN(u),u,z)))))),1)
An alternative could be this formula which returns the intended result in Excel for the web or Office 365.
tw1211
Nov 01, 2023Copper Contributor
OliverScheurichthank you for you answer!
I have tried multiple times but get each time this message of error. Do you know what the cause could be?
- OliverScheurichNov 01, 2023Gold Contributor
From the screenshot i can't tell why it doesn't work. You can open my attached file and the formula is translated into your language and the formula returns the intended result. This time i've used your tablenames Tabell1 and Tabell2.