Forum Discussion
Dynamic Count
Hi Zhangti,
| MATTER_KEY | OPEN_DATE | CLOSED_DATE | |
| 40521 | 06/28/1994 | ||
| 43921 | 06/29/1994 |
I am just providing little data, this two matters are opened in 1994 but not closed till date, then it will be counted as active date till 2023, we need to take it in count for each month of each year till date
Thanks in advance
Hi Anonymous ,
I have added a new row to your data so we could have different results but see the measure below:
Active =
COUNTROWS (
FILTER (
'Table',
(
'Table'[OPEN_DATE] <= MAX ( 'Calendar'[Date] )
&& 'Table'[CLOSED_DATE] >= max ( 'Calendar'[Date] )
)
|| (
'Table'[OPEN_DATE] <= Max ( 'Calendar'[Date] )
&& 'Table'[CLOSED_DATE] = BLANK ()
)
)
)
You need to add a disconnected calendar table to your model:
See file attach.
- Anonymous2 years agoNot applicable
Hi, can you please let me know how yoy have added only 1994 to 2023 years in calendar tabkle
beacuse when i am using same formula creating in my pbix file by using your calendar formula it's creating from 1992 to 2121, i don't know why
please help
Thanks- MFelix2 years ago
Super User
I'm using the CALENDARAUTO this picks up the min date on your dataset and the max date to get the first and last year if you want to close down the number of years try the following code instead of the calendarauto.:
CALENDAR("01/01/1994", DATE(YEAR(TODAY()),12, 31))- Anonymous2 years agoNot applicable
Hi ,
I am not getting correct count actually,
I'll share the snip of my pbix example output for may 2023 active matters
Active Data 2023 May.csv
So here the open dates below may 1st and closed date in may