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! Learn more

Reply
Anonymous
Not applicable

SQL statement. I want to create the date for the start of the weak in SQl from date and week number

HI,

 

I am trying to use SQL statement for one of my visuals. I want to create week start date from week no and date. I am posting my query please check where is the problem. it is showing wrong results. 

 

as you see in the date column, the day is 31 jan and week 4 and the start date should be 25 January.  but it is not showing the correct results. 

please help in this regard. thank you.

@Greg_Deckler @amitchandak @Fowmy @Jihwan_Kim 

hinaghous_0-1624464886940.png

hinaghous_1-1624465230320.png

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try like

 

Week to Date = var _st = date([year],1,1)
var _week = [week]
Return _st+((_week-1)*7) -WEEKDAY(_st,2)+1

 

discussed in

https://amitchandak.medium.com/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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