cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Count tickets opened and closed in the same month

Hi all 

 

I need to create a count of all ticket where the creation and closure date occurs in the same month.

 

If the reference ID was created between 01/01/2020 and 31/01/2020 and the closure date is between 01/01/2020 and 31/01/2020 then count that row. 

 

My data table has a reference id, created date and closed date.  This is linked to my date table via a 1 to many relationships from the calendar date to the data creation date. 

 

I've tried a few DAX measure but the count isn't right, I think it's due to the date relationship.  I can't remove that relation as its being used for other measures. 

 

Can anyone help?

 

thanks

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Count tickets opened and closed in the same month

Hi, Try below

 

Measure = CALCULATE(COUNT(Reference[ReferenceID]), FILTER(Reference, MONTH(Reference[Created_Date]) = MONTH(Reference[Closed_Date]) && YEAR(Reference[Created_Date]) = YEAR(Reference[Closed_Date])))
 
 

sample.PNG

 

 

Did I answer your question? If Yes, Give me a Kudo

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Count tickets opened and closed in the same month

First, sample data would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Second, see if Open Tickets helps: https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Anonymous
Not applicable

Re: Count tickets opened and closed in the same month

Hi, Try below

 

Measure = CALCULATE(COUNT(Reference[ReferenceID]), FILTER(Reference, MONTH(Reference[Created_Date]) = MONTH(Reference[Closed_Date]) && YEAR(Reference[Created_Date]) = YEAR(Reference[Closed_Date])))
 
 

sample.PNG

 

 

Did I answer your question? If Yes, Give me a Kudo

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors