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
Mike_Mace , Not very clear.
For week vs week check - With date table and week rank
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
how to create week on your choice https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482