Forum Discussion
Anonymous
8 years agoNot applicable
Count occurrences in a time interval
Hi everyone, Have been struggeling with this for a while so I have to ask if someone can help me. Been going through many forum threads but I can't get anything to work. I need to count the occu...
- Anonymous8 years ago
Try this and let me know if it works:
Count = VAR TwoWeeksafter = [Date] + 14 VAR TwoWeeksbefore = [Date] - 14 VAR PHtoCheck = [PhoneNumber] RETURN CALCULATE ( COUNTROWS (Table); ALL (Table); Table[PhoneNumber] = PHtoCheck; Table[Date] <= TwoWeeksFromDate; Table[Date] >= TwoWeeksbefore; )
v-juanli-msft
Community Support
8 years agoHi Anonymous
Could you show me how your dataset look like?
For example, columns "date","phone number", what you need is to calculate the rows of each number which doesn't exsit within a two week interval for twice times.
I wonder whether my understanding of your dataset and calculating rule are right, so I would like to hear back from you.
Best Regards
Maggie
- Anonymous8 years agoNot applicable
Thanks, Maggie v-juanli-msft. Anonymous provided a nice solution, but thanks for wanting to help :)