Updated on

Date.DayOfYear is a Power Query M function that returns a number representing the day of the year in the provided date, datetime, or datetimezone value. The function returns the day of the year as an integer.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365


Date.DayOfYear( dateTime as any ) as nullable number


Date.DayOfYear takes a date, datetime, or datetimezone value (referred to as dateTime) and returns a number ranging from 1 to 366. This number represents the position of dateTime in the year, indicating the day of the year.


The day of the year for March 1st, 2011.

// Output: 60
Date.DayOfYear( #date( 2011, 03, 01 ) )

Learn more about Date.DayOfYear in the following articles:

Other functions related to Date.DayOfYear are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: