Forum Discussion
Anonymous
6 years agoNot applicable
Count all entries last month
Hi, im wondering that this topic is not found here. I have a table with record ids, dates. This is related to an calendar table. I just want to count the records which have a date from last ...
- 6 years ago
Anonymous
please try this
Measure = VAR lastmonth=EOMONTH(today(),-2)+1 return CALCULATE(COUNT('Table'[record]),DATESBETWEEN('Table'[date],lastmonth,EOMONTH(lastmonth,0)))
Anonymous
6 years agoNot applicable
Sorry, maybe i was confusing it.
i need to count all of the values from last month.(1st - last day of month)
According to your example it should count "4".
Regards
ryan_mayu
Super User
6 years agoAnonymous
please try this
Measure =
VAR lastmonth=EOMONTH(today(),-2)+1
return CALCULATE(COUNT('Table'[record]),DATESBETWEEN('Table'[date],lastmonth,EOMONTH(lastmonth,0)))
- Anonymous6 years agoNot applicable
Hi,
im very grateful 🙂 Now it works.
But im surprised that there is not just a more simple way to filter by relative .
Thanks for your help!