cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## How to get Week START and Week END Date? Week Start = Saturday & Week End = Friday) in my date table

Hi all - question says it all.

I have a date table in my model. I need 2 columns. Week start = Saturday .. Week End Date = Friday.. If anyone could help, please provide DAX for this considering I have a date table with a date column in it.

1 ACCEPTED SOLUTION
Community Support

You can try the following methods.

Column:

``Weekday = IF(WEEKDAY('Date'[Date])<=6,WEEKDAY('Date'[Date])+1,WEEKDAY('Date'[Date])-6)``
``Weeknum = CALCULATE(COUNT('Date'[Weekday]),FILTER('Date',[Weekday]=1&&[Date]<=EARLIER('Date'[Date])))``
``Week Start = CALCULATE(MIN('Date'[Date]),FILTER('Date',[Weekday]=1&&[Weeknum]=EARLIER('Date'[Weeknum])))``
``Week End = CALCULATE(MAX('Date'[Date]),FILTER('Date',[Weekday]=7&&[Weeknum]=EARLIER('Date'[Weeknum])))``

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
Community Support

You can try the following methods.

Column:

``Weekday = IF(WEEKDAY('Date'[Date])<=6,WEEKDAY('Date'[Date])+1,WEEKDAY('Date'[Date])-6)``
``Weeknum = CALCULATE(COUNT('Date'[Weekday]),FILTER('Date',[Weekday]=1&&[Date]<=EARLIER('Date'[Date])))``
``Week Start = CALCULATE(MIN('Date'[Date]),FILTER('Date',[Weekday]=1&&[Weeknum]=EARLIER('Date'[Weeknum])))``
``Week End = CALCULATE(MAX('Date'[Date]),FILTER('Date',[Weekday]=7&&[Weeknum]=EARLIER('Date'[Weeknum])))``

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

Frequent Visitor

Week end date =date_column+(7-WEEKDAY(date_column,16))

Week start date =date_column-(7-WEEKDAY(date_column,16))

Super User

@whatisdata96 , I have two blogs for that, refer

Refer the file attached after signature

In Power Qyery you can use Date.StartOfWeek with a number change start of week

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.