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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Need Help on creating weeks with months

Hi,

 

I am working on a data set where the date range is defined by the week number of the specific year. 

For example:

1) If its 202205,that shows week number 5 of the year 2022

2)If its 202332, that shows week 32 of the year 2023

 

Can you help me with craeting week range in the date column?

 

Thanks

3 REPLIES 3
Ahmedx
Super User
Super User

pls try this

startweek date = 
var _year = VALUE(LEFT([Year-week],4))
var _week = VALUE(RIGHT([Year-week],2))
VAR _date = DATE(_year,1,-2)-WEEKDAY(DATE(_year,1,3))+_week*7
RETURN
_date-7

-----------------

Endweek date = 
var _year = VALUE(LEFT([Year-week],4))
var _week = VALUE(RIGHT([Year-week],2))
VAR _date = DATE(_year,1,-2)-WEEKDAY(DATE(_year,1,3))+_week*7
RETURN
_date

 

Anonymous
Not applicable

Can you please explain with a example. Do you need each month week number ? if you provide any example that would be better to understand 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors