Forum Discussion
Show last 4 weeks in Matrix
- 4 years ago
Hi HEW ,
Please try the following formula:
Measure = var CurWeekDay = WEEKDAY(TODAY(), 2) var DateEnd = TODAY() - CurWeekDay var DateStart = DateEnd - 7 * 4 + 1 return CALCULATE( SUM('Table'[Value]) , FILTER( Dates, Dates[Date] >= DateStart && Dates[Date] <= DateEnd ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot.
If I dont want to select a data but automatically want the last 4 weeks to be shown (based on today) and not including current week, should I use Today instead of rank?
Hi HEW ,
Please try the following formula:
Measure =
var CurWeekDay = WEEKDAY(TODAY(), 2)
var DateEnd = TODAY() - CurWeekDay
var DateStart = DateEnd - 7 * 4 + 1
return
CALCULATE(
SUM('Table'[Value]) ,
FILTER(
Dates,
Dates[Date] >= DateStart
&& Dates[Date] <= DateEnd
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.