This week filter

Hi.

I have created a slice and I want my date filter to be MON - FRI of the current week. I have tried something like [Date]>=TODAY() - WEEKDAY(TODAY()) + 1. Does not seem to be working. Am I on the right track here?

Any help would be great, thank you.

Solved Solved
0 15 728
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Try:

AND(
  ([Date] >= (TODAY() - WEEKDAY(TODAY()) + 2)),
  ([Date] <= (TODAY() - WEEKDAY(TODAY()) + 6))
)

View solution in original post

15 REPLIES 15

Try:

AND(
WEEKNUM([Date])=WEEKNUM(Today()),
OR(
WEEKDAY(TODAY())=2,
WEEKDAY(TODAY())=3,
WEEKDAY(TODAY())=4,
WEEKDAY(TODAY())=5,
WEEKDAY(TODAY())=6
))

There are more elegant ways, but this is the easiest to understand

Simon@1minManager.com

Many thanks for this @1minManager.

You would need to add the YEAR() as well. Otherwise it will give wrong result next year.

@Aleksi, thank you for that.

Can I just ask how to incorporate that into the expression?

AND(
WEEKNUM([Date])=WEEKNUM(Today()),
YEAR([Date])=YEAR(TODAY()),
OR(
WEEKDAY(TODAY())=2,
WEEKDAY(TODAY())=3,
WEEKDAY(TODAY())=4,
WEEKDAY(TODAY())=5,
WEEKDAY(TODAY())=6
))

Thanks a million @Aleksi

Steve
Platinum 4
Platinum 4

Try:

AND(
  ([Date] >= (TODAY() - WEEKDAY(TODAY()) + 2)),
  ([Date] <= (TODAY() - WEEKDAY(TODAY()) + 6))
)

Yes, you are correctโ€ฆ it doesnโ€™t handle Dec/Jan transition. I didnโ€™t think deeply enough

Worked perfectly, thank you @Steve

AND(
([Date] >= (TODAY() - WEEKDAY(TODAY()) + 2)),
([Date] <= (TODAY() - WEEKDAY(TODAY()) + 6))
)

So this works with Dec/Jan transition?? Dont wan to add it before i know )

Hi Steve, if the working days are from Sunday to Thursday (MENA region), how will this expression change? 

You may try  this expression for Sunday to Thursday time frame.

AND([date]>=EOWEEK(TODAY())-6 , [date]<=EOWEEK(TODAY())-2)

Thanks for the answer.

SELECT(Customers[Order No],
AND(
[_THISROW].[Customer ID] = [Customer ID],
DATE([Date & Time]) >= EOWEEK(TODAY())-6,
[Status] = "Paid"
)
)

Here's the expression I am trying to work with. 
Basically, I want to filter all Order No (orders) created starting from Sunday till Thursday. I am not sure what I am doing wrong here ๐Ÿ˜…

Please try and please test well for many dates

SELECT(Customers[Order No],
AND(
[_THISROW].[Customer ID] = [Customer ID],
DATE([Date & Time]) >= EOWEEK(TODAY())-6,
DATE([Date & Time])<=EOWEEK(TODAY())-2,
[Status] = "Paid"
)
)

 

This worked! Thank you so much ๐Ÿ™‚

Top Labels in this Space