Date.Day

Date

Returns the day of the month from a date value.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Date.Day(dateTime as any) as nullable number

Parameters

NameTypeRequiredDescription
dateTimeanyYesThe date value to extract the day from.

Return Value

numberThe day component of the date (1 through 31).

Remarks

Date.Day returns the day-of-month component as a number from 1 to 31 from a date, datetime, or datetimezone value. If the input is null, the function returns null.

Examples

Example 1: Extract the day from OrderDate

Table.AddColumn(
    Table.SelectColumns(
        Table.FirstN(Sales, 5),
        {"OrderID", "OrderDate"}
    ),
    "Day", each Date.Day([OrderDate]), Int64.Type
)
Result
OrderID
OrderDate
Day
111/15/202415
221/18/202418
332/1/20241
442/10/202410
553/5/20245

Example 2: Extract the day from a scalar value

#table(
    type table [Date = date, Day = number],
    {{#date(2024, 4, 15), Date.Day(#date(2024, 4, 15))}}
)
Result
Date
Day
14/15/202415

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks