Forum Discussion
Anonymous
6 years agoNot applicable
Help to filter Current week and next Week
I have dates column in a table. How can i filter the current week And next week. Thanks in Advance.. Have a great day
- 6 years ago
Hi Anonymous ,
Sorry for my late respond, we can adjust the formula as below.
Column = VAR next = TODAY () + 7 VAR yn = YEAR ( next ) VAR yt = YEAR ( TODAY () ) VAR weeknumt = WEEKNUM ( TODAY (),2 ) VAR weeknun = WEEKNUM ( next,2 ) VAR wek = WEEKNUM ( 'date'[Date],2 ) RETURN IF ( OR ( yn = YEAR ( 'date'[Date] ) && weeknun = wek, yt = YEAR ( 'date'[Date] ) && weeknumt = wek&& WEEKDAY('date'[Date],2)<=5 ), "current week & next week", BLANK () )As the picture above, Sat and Sunday have been exculded for current week.
Anonymous
6 years agoNot applicable
Thanks
Is there any option to filter only monday to friday in current week
i.e sunday and saturday to be excluded..
According to your query week is starting from sunday how to start from monday?
v-frfei-msft
Community Support
6 years agoHi Anonymous ,
Sorry for my late respond, we can adjust the formula as below.
Column =
VAR next =
TODAY () + 7
VAR yn =
YEAR ( next )
VAR yt =
YEAR ( TODAY () )
VAR weeknumt =
WEEKNUM ( TODAY (),2 )
VAR weeknun =
WEEKNUM ( next,2 )
VAR wek =
WEEKNUM ( 'date'[Date],2 )
RETURN
IF (
OR (
yn = YEAR ( 'date'[Date] )
&& weeknun = wek,
yt = YEAR ( 'date'[Date] )
&& weeknumt = wek&& WEEKDAY('date'[Date],2)<=5
),
"current week & next week",
BLANK ()
)
As the picture above, Sat and Sunday have been exculded for current week.