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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Rapaille
Helper I
Helper I

Date based on year and week

Hello all,

 

In Power BI Power Query I want to create a date table. The end day is today and my startday should be the date of the calculated Monday of the week and year columns. 

 

Can someone help me with this?

 

Rapaille_1-1741006936439.png

 

Thank you in advance for your help.

 

Kind regards,

 

Hans

 

 

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

For StartDate, go to the "Add Column" tab and select "Custom Column" :

 

Date.AddDays(Date.FromText(Text.From([Year]) & "-01-01"), (([Week] - 1) * 7) - Date.DayOfWeek(Date.FromText(Text.From([Year]) & "-01-01"))

 

 

and for the Enddate :

 

DateTime.Date(DateTime.LocalNow())

If you can provide some data, it will be helpful 🙂

 

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

2 REPLIES 2
Rapaille
Helper I
Helper I

Hi @AmiraBedh,

 

Thank you for your help. That was exactly where I was looking form

 

Kind regards,

 

Hans

AmiraBedh
Super User
Super User

For StartDate, go to the "Add Column" tab and select "Custom Column" :

 

Date.AddDays(Date.FromText(Text.From([Year]) & "-01-01"), (([Week] - 1) * 7) - Date.DayOfWeek(Date.FromText(Text.From([Year]) & "-01-01"))

 

 

and for the Enddate :

 

DateTime.Date(DateTime.LocalNow())

If you can provide some data, it will be helpful 🙂

 

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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