Downloads
Power Query MDateBeginner

Date.Day

Returns the day of the month of a date or datetime, from 1 to 31.

Syntax
Date.Day(dateTime as any) as nullable number

Returns: The day as a number, or null when the input is null.

What it does

Date.Day returns the day of the month. It is useful for cut-off rules, such as "postings on the 25th or later belong to next month", and for billing schedules that run on a fixed day. It does not tell you the weekday. Use Date.DayOfWeek for that.

Syntax and arguments

Example

A company's payroll cut-off is the 25th of each month. Entries dated on or after the 25th are moved to the next month's payroll.

let
    Entries = #table(type table [Entry = text, EntryDate = date],
        {{"E-1", #date(2026, 10, 24)}, {"E-2", #date(2026, 10, 25)}, {"E-3", #date(2026, 10, 29)}}),
    WithDay = Table.AddColumn(Entries, "Day", each Date.Day([EntryDate]), Int64.Type),
    Cutoff = Table.AddColumn(WithDay, "Period", each if [Day] >= 25 then "Next payroll" else "This payroll", type text)
in
    Cutoff

E-1 falls on day 24 and stays in this payroll. E-2 and E-3 fall on day 25 or later and move to next payroll. The rule is written in one place, so it can be checked against the policy.

Example: a second, different use

Flag bills due on the first of the month so the team can plan for an early payment run.

Things to watch

In business terms

Payroll cut-offs, billing days and the close calendar are often defined by day of month. Writing the rule as a query keeps it consistent between months and easy to audit.

Related functions

All Power Query M functions · View as Markdown · M basics