Forum Discussion
Mike_Mace
6 years agoResolver I
Countrows on weekly periods
Happy August-ing developers Some help from whom can lend an ear I have table A. showing entries data by created date I have table B. showing historic performance per specific dates The two dat...
- 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
Anonymous
6 years agoNot applicable
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_Mace
6 years agoResolver I
hi Anonymous
The column one is what I was after
Many thanks!