Forum Discussion
Generate Dates
I want to create two measures that would generate the following date range for the current week and previous week. A new week starts on a sunday and ends on a saturday. I want the current week's date range to continue to update as the week increases. so for example, this week's date range as of today would be 08/09/20 - 08/13/20, then tomorrow would show 08/09/20 - 08/14/20 until the week completes etc . Thanks
Please try these two measure expressions
Current Week = var thisday = TODAY()return thisday - WEEKDAY(thisday) +1 & " - " & thisdayPrevious Week = var thisday = TODAY()return thisday - WEEKDAY(thisday) -6 & " - " & thisday-WEEKDAY(thisday)If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years ago
Thanks for your response but your solution is not clear. I'm not sure what I'm suppose to be looking a but this is what I'm seeing below. Please clarify.
Current Week = var thisday = TODAY()return thisday - WEEKDAY(thisday) +1 & " - " & thisdayPrevious Week = var thisday = TODAY()return thisday - WEEKDAY(thisday) -6 & " - " & thisday-WEEKDAY(thisday)
8 Replies
- amitchandakSuper User
Anonymous , not very clear to me .
refer to this post you can generate a calendar that can start on any week day
- AnonymousNot applicable
Thanks for your response, what i want is simply to find :
1) Current week's start and end date (date range)
2) Previous week's start and end date(date range)For example, as of today the first measure (current week) would return 08/09/2020 to 08/13/2020 (continues to update till the end of the current week which would be 08/15/2020
Again, as of today the second measure for the previous week would return 08/02/2020 to 08/08/2020
- mahoneypatMicrosoft Employee
Please try these two measure expressions
Current Week = var thisday = TODAY()return thisday - WEEKDAY(thisday) +1 & " - " & thisdayPrevious Week = var thisday = TODAY()return thisday - WEEKDAY(thisday) -6 & " - " & thisday-WEEKDAY(thisday)If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat