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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

DAX - Week End Date

Hi All,

I am creating a date table and I would like a column for the end of week (sunday) for each week. I've tried;

 

"Week End Date", [Date] - WEEKDAY([Date],2)+7,

But you can see it isn't working.

 

weekday.JPG

 

 

 

 

"Week End Date", [Date] - MOD([Date]-2,7)+6,
This doesn't work either.
mod.JPG
 
 
 
 
 
 
 
 

Date =
VAR MinYear = YEAR ( MIN ( 'Flights'[Start date ] ) )
VAR MaxYear = YEAR ( MAX ( 'Flights'[Start date ] ) )

RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Weekday number", WEEKDAY( [Date] ),
"Week End Date", [Date] - WEEKDAY([Date],2)+7,
"Week Number", WEEKNUM([Date],2),
"Quarter", "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)

 

Thanks for any help.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , weekend

Sunday

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

 

Saturday

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

 

for all other week day, refer to my blog and files

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482

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

2 REPLIES 2
Shadow_BN515
New Member

Thank you for this, I search everywhere. This is so simple and works great!

amitchandak
Super User
Super User

@Anonymous , weekend

Sunday

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

 

Saturday

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

 

for all other week day, refer to my blog and files

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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