Skip to main content

How to Show That a Shift Ends the Next Day in Power Apps

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A night shift shown as 22:00 to 06:00 reads as if it ends before it starts. Adding next day when the finish falls on a later day than the shift's date makes it clear: 22:00 to 06:00 next day. The check is Day(EndTime) <> Day(WorkDate) inside an If.

The example is the Overtime Timesheet app, where a shift can run past midnight and is still one entry, dated the day it started.

Prerequisites​

Step 1: Work It Out​

The shift's WorkDate is the day it started; its EndTime is the real finish, a date and time. If the finish's day of the month isn't the shift's, the shift ended the next day. I tried it with the night of 24 October 2026, using With to stand in for the three columns (How to Use the With Function in Power Apps):

Any text control → Text
With(
{WorkDate: Date(2026, 10, 24), StartTime: DateTime(2026, 10, 24, 22, 0, 0), EndTime: DateTime(2026, 10, 25, 6, 0, 0)},
$"{Text(StartTime, "hh:mm")} to {Text(EndTime, "hh:mm")}{If(Day(EndTime) <> Day(WorkDate), " next day", "")}"
)
  • Text(..., "hh:mm") shows each time on a 24-hour clock.
  • If adds " next day" when the days differ, and nothing when they're the same.

The expanded formula bar with the With formula for a shift from 24/10/2026 22:00 to 25/10/2026 06:00, and the preview strip reading 22:00 to 06:00 next day with Data type text

Why Comparing the Day Is Enough​

The app doesn't allow a shift longer than 24 hours, so the finish is on the shift's date or the day after. Two different days of the month can only mean the next day, even across the end of a month: a shift from 31 October to 1 November has days 31 and 1.

If your shifts can be longer than a day, compare the whole dates instead of only the day of the month.

How the Example Uses It​

Each row of the My Overtime screen's gallery shows the times and the hours on one line (How to Use ThisItem in a Power Apps Gallery):

lblEntryTimesMO → Text
$"{Text(ThisItem.StartTime, "hh:mm")} to {Text(ThisItem.EndTime, "hh:mm")}{If(Day(ThisItem.EndTime) <> Day(ThisItem.WorkDate), " next day", "")}, {Text(ThisItem.Hours, "0.00")} hours"

The night shift of 24 October in Preview:

A gallery row in Preview: Sat 24/10/2026, 22:00 to 06:00 next day, 8.00 hours, Emergency Department, and an Approved badge

Shifts that end the same day, such as 18:00 to 20:00, 2.00 hours, have no next day.

Common Mistakes​

MistakeWhat happensDo this instead
Storing only times, not datesNothing tells you which day the shift endedStore the real finish as a date and time
Formatting with "hh:mm AM/PM"A 12-hour clock with AM and PM"hh:mm" for 24-hour times

Troubleshooting​

SymptomLikely causeFix
next day on every rowEndTime holds the wrong date, or the formula compares the wrong columnsCheck both columns in the list
next day never appearsEndTime was saved on the start dateSave the real finish: How to Save a Date and Time to a SharePoint List with Patch in Power Apps

FAQ​

Can I show the finish date instead?​

Yes: Text(ThisItem.EndTime, "dd/mm hh:mm") shows 25/10 06:00. next day is shorter on a phone.

Conclusion​

If(Day(EndTime) <> Day(WorkDate), " next day", "") after the times makes a night shift read the way it was worked. It works because a shift is never longer than 24 hours.

Additional Resources​