Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 day of the week - just wondering if the function has the capability.
Thanks
David
Solved! Go to Solution.
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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThanks @edhans - I initially didn't see the option come up in the editor.
David
I've often seen parameters fail to show up until you hit the comma before that parameter, and if you don't know to look for it with a comma....
I wouldn't rely on Intellisense in PQ to help in the same way it does in DAX or in Excel. It isn't quite at that level.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingYes, 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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThis is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |