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 - You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Otherwise, Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.