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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Date table addition

Hi Guys, 

 

I have a date table and i want to add a combination of the weeknumber - first day of that week - last day of that week. 

 

I have the columns Date and Weeknum, so this is enough to create the combination above. Someone any idea how to fix this? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try

Week Start date = DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY)
Week End date = DATEADD('Date'[Date],7-1*WEEKDAY('Date'[Date]),DAY)
Week of = format(DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY),"mm/dd/yy"  & " - " & format(DATEADD('Date'[Date],7-1*WEEKDAY('Date'[Date]),DAY),"mm/dd/yy"))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Please check the formula below.

Column = 
var first = CALCULATE(MIN('Date'[Date]),FILTER('Date','Date'[weeknum]=EARLIER('Date'[weeknum])))
var last = CALCULATE(MAX('Date'[Date]),FILTER('Date','Date'[weeknum]=EARLIER('Date'[weeknum])))
return
"week"&'Date'[weeknum]&"-"&first&"-"&last

Result would be shown as below.

 1.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Try

Week Start date = DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY)
Week End date = DATEADD('Date'[Date],7-1*WEEKDAY('Date'[Date]),DAY)
Week of = format(DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY),"mm/dd/yy"  & " - " & format(DATEADD('Date'[Date],7-1*WEEKDAY('Date'[Date]),DAY),"mm/dd/yy"))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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
az38
Community Champion
Community Champion

Hi @Anonymous 

you can use the next statements for calculation:

FirstDayOfWeek = 'Date'[Date] - WEEKDAY('Date'[Date],2)+1

and

LastDayOfWeek = 'Date'[Date] - WEEKDAY('Date'[Date],2)+7

 

then use CONCATENATE function https://docs.microsoft.com/en-us/dax/concatenate-function-dax to get any combination you wish in desired format

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

What i want: “week1 - 1/1/2020 - 1/7/2020” do i achieve this with your solution?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors