Forum Discussion
This week date measure
- Anonymous4 years ago
Hi Anonymous ,
I think you want the matrix to show the values for this week and the previous week.
Here's my solution.
1.Create a calendar table.
Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))2.Create a measure, put it into visual level filters and set show items when the value is 1.
Measure = var _thisweek=WEEKNUM(TODAY(),2) var _week=WEEKNUM(MAX('Calendar'[Date]),2) return IF(_thisweek=_week||_thisweek-1=_week,1)As shown above, the view shows the data for this week and the previous week.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
I think you want the matrix to show the values for this week and the previous week.
Here's my solution.
1.Create a calendar table.
Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
2.Create a measure, put it into visual level filters and set show items when the value is 1.
Measure = var _thisweek=WEEKNUM(TODAY(),2)
var _week=WEEKNUM(MAX('Calendar'[Date]),2)
return IF(_thisweek=_week||_thisweek-1=_week,1)
As shown above, the view shows the data for this week and the previous week.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Stephen, i am trying to create a filter that once i click on it it will show me "This Week" and "This Month."
This example got me pretty close but wondering if you could me.
Thank you,
Pablo
- Ritaf19833 years ago
Super User
Hi PabloGiraldo
Could you please clarify what these periods of time mean?
Does "today" refer to the day the user looks at the report?
Does the current week start on "today" and last -7 days?
Does the current month start on "today" and last -30 days?- PabloGiraldo3 years ago
Helper IV
"Today" referes to the day the user looks at report.
Current week will be Monday through Friday. So taking this week as an example, current week will be May 15th through May 19th.
Current Month will be May 1st through May 31st.
Thank you!
- Ritaf19833 years ago
Super User
It is difficult to produce a slicer you are interested in because the periods are included in each other.
There is the option of a generic slicer
The relative date.
My recommendation is to simply use it:If this post helps, then please consider Accept it as the solution to help the other members find it more quickly