Forum Discussion
awal2018
8 years agoRegular Visitor
First Middle Last Dates
I am working for a hotel company, and we have a list of Guest ID's and their Stay dates, I want to determine which stays were a first, middle or last day. ID Stay Date Frist Middle Last 2 1/1/2...
- 8 years ago
Try with this formula :
Status = IF( ISBLANK(DateAdd(Guests[Dates];-1;DAY));"First Day"; IF ( ISBLANK(DateAdd(Guests[Dates];1;DAY) ) ; "Last Day" ; "Middle Day" ) )
- 8 years ago
Hi, try with this calculated column:
Day = VAR StayDate = Table1[StayDate] - 1 VAR StayDate_plus1 = Table1[StayDate] + 1 RETURN IF ( COUNTROWS ( FILTER ( Table1; Table1[StayDate] = StayDate && Table1[GuesID] = EARLIER ( Table1[GuesID] ) ) ) < 1; "First"; IF ( COUNTROWS ( FILTER ( Table1; Table1[StayDate] = StayDate_plus1 && Table1[GuesID] = EARLIER ( Table1[GuesID] ) ) ) < 1; "Last"; "Middle" ) )Regards
Victor
Salonic
8 years agoResolver I
Try with this formula :
Status = IF( ISBLANK(DateAdd(Guests[Dates];-1;DAY));"First Day"; IF ( ISBLANK(DateAdd(Guests[Dates];1;DAY) ) ; "Last Day" ; "Middle Day" ) )