Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Error in DimDate Table - Start week on Monday and End on Sunday

Hi Experts

 

Please ref to Dimdate Table in Sample Data. I want to start my week on Monday and End on Sunday...All my calculation are correct upto WeekNo Column there after they need tweeking. 

 

Week Commencing 

Week_Number_Commencing

WeeksInMonth

The other should correct themselves

 

As per calander 1 Jan 2020 was on a Wed and 5 Jan 2020 was on sunday...  currently my Dimdate show sunday in week 2. should be week 1.

 

sample file

https://www.dropbox.com/s/0uyn8c6feqra1bs/Test_.pbix?dl=0 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , refer these columns, if they can help

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

 

min week start of year = minx(filter('Date',year([Week Start date])=earlier(year(Week Start date]))),[Week Start date])

week No = quotient(datediff([min week start of year],[date],day),7)+1

 

Start Month = STARTOMONTH('Date'[Date])

 

Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , refer these columns, if they can help

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

 

min week start of year = minx(filter('Date',year([Week Start date])=earlier(year(Week Start date]))),[Week Start date])

week No = quotient(datediff([min week start of year],[date],day),7)+1

 

Start Month = STARTOMONTH('Date'[Date])

 

Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors