Forum Discussion
FaisalImam
Helper I
4 years agoDax Query to get data opened before this month
Hi Team,
I need to show the count of tickets that were opened before this month and are resolved or still open in the present month..
I have written a Measure but getting wrong count :
backlog = CALCULATE(COUNT(Incident[NUMBER]),FILTER(Incident,Incident[OPENED].[MonthNo] < MONTH(TODAY())),FILTER(Incident,Incident[RESOLVED].[MonthNo] = MONTH(TODAY()) || BLANK()))
I am getting wrong count because when filtering { month no < month(today) , it excludes tickets that are opened in month - (7-12) of previous years.. i need to include that.
Please modify the query in best possible way
2 Replies
- amitchandak
Super User
FaisalImam , A measure like
backlog = CALCULATE(COUNT(Incident[NUMBER]),FILTER(Incident,eomonth(Incident[OPENED],0) <= eomonth(Today(),-1)
&& (isblank(Incident[RESOLVED]) || eomonth(Incident[RESOLVED],0) > eomonth(Today(),-1) )) )Also, refer
- FaisalImam
Helper I
Thank you somuch sir amitchandak .
logic worked perfectly. Can you explain " eomonth(Incident[OPENED],0) <= eomonth(Today(),-1"