Forum Discussion
Filtering on Last complete week
- 7 years ago
Unfortunately no.
Can't share it.
Anyhow. I think I solved it. I managed to get the last 2 weeks with the metric:
Last2Weeks =
VAR ThisWeek =
CALCULATE (
MAX( 'Fiscal Calendar'[Calendar Date] ),
FILTER (
ALL ('Fiscal Calendar' ),
'Fiscal Calendar'[Week Completed Flag]="Y"
)
)
RETURN
IF(
MAX('Fiscal Calendar'[Calendar Date])+6>=ThisWeek
,1
,blank()
)and then I just filtered the visual with the Complete Week Flag='Y' and the Last2Weeks metric to be = 1
I'm just wondering fi the second part of the return is correct. MAX('Fiscal Calendar'[Calendar Date])+6>=ThisWeek
Could you share a data sample? nerra
Unfortunately not. it's confidential. LivioLanzo
however,
i have a matrix showing
week id, store, employee and a sum(hours).
i need to filter it for the last complete week.
Data is loaded every day. WeekEnd is Wednesday.
- LivioLanzo7 years agoSolution Sage
- nerra7 years agoHelper II
I managed to get some data but it's not quite correct since it's based on yesterday's date.
Last2Weeks =
VAR ThisWeek =
CALCULATE (
MAX( 'Fiscal Calendar'[Calendar Date] ),
FILTER (
ALL ('Fiscal Calendar' ),
'Fiscal Calendar'[Week Completed Flag]="Y"
)
)
RETURN
IF(
MAX('Fiscal Calendar'[Calendar Date])+6>=ThisWeek
,1
,blank()
)- LivioLanzo7 years agoSolution Sage