Forum Discussion
Calculating weeknumber based on date and time
Im trying to add a weeknumber column, based on creationdates of id's in the table, with weeks running from friday 17:00 till the next friday 16:59:59
for example
|
| ||
| id | creation date |
| weeknr |
| 1 | 02/11/2022 09:06:12 | 44 | |
| 2 | 12/08/2022 13:27:03 | 41 |
How can I do this? I manage to do from friday till thursday for example, but without the time measure
3 Replies
- amitchandak
Super User
TechR21 , These blogs can help you get week that start from Friday
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e6f593958- TechR21
Helper V
thank you. but how to include the time to make the selection, this part I dont get right
- v-henryk-mstf
Community Support
Hi TechR21 ,
Based on the test data you provided, don't quite understand how to get a custom number of weeks based on the current date.
By running from friday 17:00 till the next friday 16:59:59 do you mean specifying friday 17:00 as 00:00 on the first day of the weekday (which includes weekends or not).
I look forward to your further description and screenshots of the expected results, and I will get back to you as soon as possible.
Best Regards,
Henry