OpenBI Docs Buy

Date.StartOfDay

Midnight at the start of the same day, for a datetime or datetimezone; a date comes back as it is.

Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Date.StartOfDay(dateTime as any) as any
ParameterTypeDescription
dateTimeanyA date, datetime or datetimezone value; null gives null.

Returns

any. The same kind of value, at 00:00:00; a date unchanged.

Remarks

  • A datetimezone keeps its offset: the day is its own clock's day, not UTC's.

Examples

The day an order was placed

Date.StartOfDay(#datetime(2024, 3, 15, 14, 30, 0))
#datetime(2024, 3, 15, 0, 0, 0)

With a time zone

Date.StartOfDay(#datetimezone(2024, 3, 15, 9, 30, 0, 1, 0))
#datetimezone(2024, 3, 15, 0, 0, 0, 1, 0)

A date

Date.StartOfDay(#date(2024, 3, 15))
#date(2024, 3, 15)

A date has no time of day, so it is its own start: a column of dates and datetimes can go through one step.

Date.EndOfDay, DateTime.Date, Date.StartOfMonth.

Last updated · OpenBI Studio 0.3.79