Forum Discussion
Countrows on weekly periods
- Anonymous6 years ago
Hi Mike_Mace,
My formula is a measure please create a measure and copy the code into measure expression to use it:
Entries New/week test 2= VAR currDate = MAX ( 'Performance Table'[Dates] ) RETURN CALCULATE ( COUNTROWS ( 'Entries Table' ), FILTER ( ALLSELECTED ( 'Entries Table'), YEAR ( [Created]) = YEAR ( currDate ) && WEEKNUM ( [Created] ) = WEEKNUM ( currDate ) ) )If you want a calculated column version, you can try to use following calculated column formula: (Notice: calculated column/table did not dynamic changes based on filters/slicers)
Entries New/week test 2 = CALCULATE ( COUNTROWS ( 'Entries Table' ), FILTER ( ALLSELECTED ( 'Entries Table' ), YEAR ( [Created] ) = YEAR ( EARLIER ( 'Performance Table'[Dates] ) ) && WEEKNUM ( [Created] ) = WEEKNUM ( EARLIER ( 'Performance Table'[Dates] ) ) ) )Regards,
Xiaoxin Sheng
Hi Anonymous ,
Of course, here's the right link for it
https://1drv.ms/u/s!Amf63tQXGj5rklkr-5wKw8XgwEK1
Hi Mike_Mace,
My formula is a measure please create a measure and copy the code into measure expression to use it:
Entries New/week test 2=
VAR currDate =
MAX ( 'Performance Table'[Dates] )
RETURN
CALCULATE (
COUNTROWS ( 'Entries Table' ),
FILTER (
ALLSELECTED ( 'Entries Table'),
YEAR ( [Created]) = YEAR ( currDate )
&& WEEKNUM ( [Created] ) = WEEKNUM ( currDate )
)
)
If you want a calculated column version, you can try to use following calculated column formula: (Notice: calculated column/table did not dynamic changes based on filters/slicers)
Entries New/week test 2 =
CALCULATE (
COUNTROWS ( 'Entries Table' ),
FILTER (
ALLSELECTED ( 'Entries Table' ),
YEAR ( [Created] ) = YEAR ( EARLIER ( 'Performance Table'[Dates] ) )
&& WEEKNUM ( [Created] ) = WEEKNUM ( EARLIER ( 'Performance Table'[Dates] ) )
)
)
Regards,
Xiaoxin Sheng
- Mike_Mace6 years ago
Resolver I
hi Anonymous
The column one is what I was after
Many thanks!