Date.WeekOfMonth Function in Power Query

The Date.WeekOfMonth function in Power Query (M language) returns the week number of the month for a given date value. The first week starts at 1, and the start of the week depends on the optional firstDayOfWeek parameter (default is Sunday).

Syntax

Date.WeekOfMonth(
    dateTime as any,
    optional firstDayOfWeek as nullable number
) as nullable number

The function has the following parameters:

Return Value

Key Points

Example: Default (week starts Sunday).

Power Query M

let
    Source = Date.WeekOfMonth(#date(2025, 8, 24))
in
    Source      

The output of the above code is 5.

Example: First day of month.

Power Query M

let
    Source = Date.WeekOfMonth(#date(2025, 8, 1))
in
    Source  

The output of the above code is 1.