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!View all the Fabric Data Days sessions on demand. View schedule
Hello all.
Need help creating a date table in Power Query. Require date column and week number but start of the week should be Tuesday. Is it possible and could you help with the M code?
Solved! Go to Solution.
Hello @Anonymous
this code creates a table with dates starting from beginning of 2018 for 3000 days and adds a new column with the week of the year, using tuesday as starting day
let
Source = List.Dates(#date(2018,1,1), 3000, #duration(1,0,0,0)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Date"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "WeekofYear starting from Tuesday", each Date.WeekOfYear([Date], Day.Tuesday))
in
#"Added Custom"
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hello @Anonymous
this code creates a table with dates starting from beginning of 2018 for 3000 days and adds a new column with the week of the year, using tuesday as starting day
let
Source = List.Dates(#date(2018,1,1), 3000, #duration(1,0,0,0)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Date"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "WeekofYear starting from Tuesday", each Date.WeekOfYear([Date], Day.Tuesday))
in
#"Added Custom"
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hi this is a solution to something I am working on but the output is the day number, how can I convert this into a date? So I end up with a column called week and it will group the data by weeks starting on a Tuesday.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 10 | |
| 9 | |
| 6 | |
| 5 | |
| 3 |