Forum Discussion
Qlik Weekstart function into DAX
- 4 years ago
Hi Anonymous,
You may try this Calculated column.
DueInWeeks = VAR WeekStart = TODAY () - WEEKDAY ( TODAY (), 3 ) VAR Condition_ = ReportingCommitments[RPT_RequiredDate] >= TODAY () && ReportingCommitments[RPT_StatusId] <> 60 RETURN IF ( Condition_ && ReportingCommitments[RPT_RequiredDate] <= ( WeekStart + 98 ), "Due in 1-16 Weeks", IF ( Condition_ && ReportingCommitments[RPT_RequiredDate] > ( WeekStart + 98 ), "Due in more than 16 weeks", "" ) )Then, the result looks like this.
Also, attach the pbix file as reference. Hope it helps.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Anonymous ,
Monday
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
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
Power query
Date.StartOfWeek and Date.EndOfWeek: https://www.youtube.com/watch?v=8HNicSedIds&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=104