Date.StartOfDay Function in Power Query

The Date.StartOfDay function in Power Query (M language) is used to return the start of the day (00:00:00) for a given date or datetime value. It effectively resets the time portion to midnight.

Syntax

Date.StartOfDay(dateTime as any) as any

The function has the parameter:

Return Value

Key Points

Example: Reset time to midnight.

Power Query M

let
    Source = Date.StartOfDay(#datetime(2025, 8, 24, 15, 45, 30))
in
    Source    

The output of the above code is:
#datetime(2025, 8, 24, 0, 0, 0)

Example:

Power Query M

let
    Source = Date.StartOfDay(#date(2025, 8, 24))
in
    Source        

The output of the above code is:
#date(2025, 8, 24)

Example: With datetimezone.

Power Query M

let
    Source = Date.StartOfDay(#datetimezone(2025, 8, 24, 15, 45, 30, 5, 30))
in
    Source        

The output of the above code is:
#datetimezone(2025, 8, 24, 0, 0, 0, 5, 30)