Forum Discussion
Static Previous weeks Counts
- 5 years ago
Hi, Anonymous
Please try the below.
Item count previous week =CALCULATE (DISTINCTCOUNT ( [ITEM Number] ),FILTER ('Table',WEEKNUM ( 'Table'[Close Date], 1 )= WEEKNUM ( TODAY (), 1 ) - 1))Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Hi, Anonymous
Thank you for your message.
Please try something like the below, that one more condition is added.
Item count previous week =
VAR currentyear =
YEAR ( TODAY () )
RETURN
CALCULATE (
DISTINCTCOUNT ( [ITEM Number] ),
FILTER (
'Table',
WEEKNUM ( 'Table'[Close Date], 1 )
= WEEKNUM ( TODAY (), 1 ) - 1
&& YEAR ( 'Table'[Close Date] ) = currentyear
)
)
I did tied that but it was retruning below error
A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.