Forum Discussion
Lookup previous date within table
- 5 years ago
Hi rbreneman
If the bed ID is the column you want to identify the bed, then this will give you the previous end date:
= CALCULATE ( MAX ( Table1[EndDate] ), Table1[StartDate] < EARLIER ( Table1[StartDate] ), ALLEXCEPT ( Table1, Table1[BedID] ) )you can then use that in your datediff. Probably best would be to assign the value above to a VAR. You should also check for blanks, which will come up in cases as the last row, before applying the datediff
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi rbreneman
If the bed ID is the column you want to identify the bed, then this will give you the previous end date:
=
CALCULATE (
MAX ( Table1[EndDate] ),
Table1[StartDate] < EARLIER ( Table1[StartDate] ),
ALLEXCEPT ( Table1, Table1[BedID] )
)
you can then use that in your datediff. Probably best would be to assign the value above to a VAR. You should also check for blanks, which will come up in cases as the last row, before applying the datediff
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- rbreneman5 years agoHelper II
Sorry for the delay in responding as I got pulled away onto other things. This was perfect! Worked exactly as I hoped. Thank you again so much, really appreciate your help! Have a great day!