Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
FaisalImam
Helper I
Helper I

Dax 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 2
amitchandak
Super User
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

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Thank you somuch sir @amitchandak . 

 

logic worked perfectly. Can you explain " eomonth(Incident[OPENED],0) <= eomonth(Today(),-1"

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.