Forum Discussion
heidibb
Helper IV
9 years agoCreate column with Earlier value from another row
Hello, I have a data table similar to this (the first three columns). I would like to create a column that pulls in the previous week's date. I think from my research I should use the EARLIER fun...
- 9 years ago
Hi heidibb,
If I understand you correctly, you should be able to use the formula below to create a column that pulls in the previous week's date in your scenario. :smileyhappy:
Previous Week Date = CALCULATE ( MAX ( Table1[Date] ), FILTER ( ALL ( Table1 ), Table1[ID] = EARLIER ( Table1[ID] ) && Table1[Week] = EARLIER ( Table1[Week] ) - 1 ) )Regards
v-ljerr-msft
Microsoft Employee
9 years agoHi heidibb,
If I understand you correctly, you should be able to use the formula below to create a column that pulls in the previous week's date in your scenario. :smileyhappy:
Previous Week Date =
CALCULATE (
MAX ( Table1[Date] ),
FILTER (
ALL ( Table1 ),
Table1[ID] = EARLIER ( Table1[ID] )
&& Table1[Week]
= EARLIER ( Table1[Week] ) - 1
)
)
Regards