Forum Discussion

dedelman_clng's avatar
dedelman_clng
Icon for Community Champion rankCommunity Champion
5 years ago
Solved

Date.WeekOfMonth to start on Monday?

Is there a switch for the PowerQuery/M function Date.WeekOfMonth that will tell it that a week is Monday-Sunday instead of Sunday-Saturday?   I know I can do it with an IF statement based on the ...
  • edhans's avatar
    5 years ago

    Yes, just change the start day parameter:

     

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

     

    Use Day.Monday for the FirstDayOfWeek parameter.

     

    Many of the date functions, especially the Week functions, have this. They assume Day.Sunday I think, but you can easily change that to any day of the week.