OpenBI Docs Buy

Date.DayOfYear

The day's number within its year: 1 for 1 January, up to 365 or 366.

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

Syntax

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

Returns

nullable number. The day of the year.

Examples

The first of March in a leap year

Date.DayOfYear(#date(2024, 3, 1))
61

31 days of January and 29 of February come first.

New Year's Eve

Date.DayOfYear(#date(2024, 12, 31))
366

Date.DaysInMonth, Date.IsLeapYear, Date.WeekOfYear.

Last updated · OpenBI Studio 0.3.79