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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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