Forum Discussion
Dynamic Count
Hi, Anonymous
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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
- MFelix2 years agoSuper User
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 agoSuper 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))