Forum Discussion
Anonymous
3 years agoNot applicable
Count events between two dates
Hey there I'm facing a situation where I must calculate how many occurrences (from the Fact table) took place between two dates (that also comes from my Fact table). This is my fact ...
- Anonymous3 years ago
This piece of code solved my problem:
COUNTROWS(FILTER(ALL(Data), MAX('Calendar'[Date]) > [EventStart] && MAX('Calendar'[Date]) < [EventEnd]))
Jihwan_Kim
3 years agoSuper User
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Active events count: =
COUNTROWS (
FILTER (
Data,
Data[EventEnd] >= MIN ( 'Calendar'[Date] )
&& Data[EventStart] <= MAX ( 'Calendar'[Date] )
)
)
Anonymous
3 years agoNot applicable
This piece of code solved my problem:
COUNTROWS(FILTER(ALL(Data), MAX('Calendar'[Date]) > [EventStart] && MAX('Calendar'[Date]) < [EventEnd]))