Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi everyone,
I need a little help to solve this: In Power Query, I have a calendar table with the dates of the year.
Through the expressions Date.StartOfWeek([Data]) and Date.EndOfWeek([Data]) I know the start date and end date of each week (of the year?).
But this brings me a result that I cannot use, since in the week of 09/01/20, I want the beginning of the week of September to be considered 09/01/20 (tuesday) and not 08/30/20 (sunday). The same behavior I want for the end of the week. If the month ends on a Thursday, for example, I want that date to be considered.
Any suggestions?
Solved! Go to Solution.
Hi @LeandroCampacci ,
You can add an optional parameter in the function Date.StartofWeek() and Date.EndofWeek() to define the start / end day of each week:
= Table.AddColumn(#"Added Custom", "Start", each Date.StartOfWeek([Date],2))
= Table.AddColumn(#"Added Custom1", "End", each Date.EndOfWeek([Date],4))
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @LeandroCampacci ,
You can add an optional parameter in the function Date.StartofWeek() and Date.EndofWeek() to define the start / end day of each week:
= Table.AddColumn(#"Added Custom", "Start", each Date.StartOfWeek([Date],2))
= Table.AddColumn(#"Added Custom1", "End", each Date.EndOfWeek([Date],4))
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Oh "sheet", my fault. I used more than 50% of my brain now. 🤣
For the start of the week on currently month:
if [Semana do Mês] = 1
then Date.StartOfMonth([Data])
else Date.StartOfWeek([Data])
Now for the end of the week I don't know if the rule is the same, since the month can end in week 5, 6...
Maybe this?
if [Semana do Mês] = 5 or [Semana do Mês] = 6
then Date.EndOfMonth([Data])
else Date.EndOfWeek([Data])
Proud to be a Super User!
Proud to be a Super User!
Sorry, @vanessafvg. See this GIF: https://imgur.com/0XdSDHb
On first Column show the first day of September Note that the week of the month ("semana do mês") column shows the value "1" for that row, representing the first week of September. But in the next column, beginning of the week ("inicio da semana"), the date is 08/30/20. I need to be 09/01/20.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.