March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a date table with week number based on the calender year. Each week starts from monday and ends on sunday. I want to create a custom week number based on months, each month will have week1, 2, 3,4,5.
Below is a sample of my date table.
Thanks for the assistance.
Solved! Go to Solution.
@Selded , Try new columns like. You might have some the dependent colums with different name
Start Month = STARTOMONTH('Date'[Date])
WeekDay = WEEKDAY([Date],2) //monday
Start of Week = [Date] -[WeekDay]+1 //monday
Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1
in power query under transform ribbon bar, select date (has a calendar looking thing) drop down to week from the menu and you should be able to choose week of month there, duplicate your date column before you do this.
Proud to be a Super User!
This worked , but unfortuantely my date table has week day starting on monday instead of Sunday. how do i edit the start day of my week to get this sorted correctly.
in power query under transform ribbon bar, select date (has a calendar looking thing) drop down to week from the menu and you should be able to choose week of month there, duplicate your date column before you do this.
Proud to be a Super User!
This worked , but unfortuantely my date table has week day starting on monday instead of Sunday. how do i edit the start day of my week to get this sorted correctly.
Proud to be a Super User!
Thank you both, i got the week numbers correctly.
please is there a way to for the column to read week 1 , week 2, instead of 1,2, 3.
Thank you
Proud to be a Super User!
@Selded , Try new columns like. You might have some the dependent colums with different name
Start Month = STARTOMONTH('Date'[Date])
WeekDay = WEEKDAY([Date],2) //monday
Start of Week = [Date] -[WeekDay]+1 //monday
Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |