The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a set of data with dates starting on 1/5/2020. I need to group these dates in a column into 2 week intervals with the last Saturday date being the return value. These dates always begin on a Sunday and end on a Saturday. For example:
1/5/2020 would return 1/18/2020
1/17/202 would return 1/18/2020
1/19/2020 would return 2/1/2020
and so on
Solved! Go to Solution.
@Blake753 , Try like
Week end date = date(2020,1,5) + (Quotient(datediff(date(2020,1,5),[Date],day),14)+1)*14
@Blake753 , You can divide into week like this
2 Week No = Quotient(datediff(date(2020,1,5),[Date],day),14)+1
Week end date = date(2020,1,5) + (Quotient(datediff(date(2020,1,5),[Date],day),14)+2)*7
@amitchandak I had to change the start date to January 4, 2020 as it was one day off but it seems to have worked, thank you very much
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |