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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
nicplancho
Helper I
Helper I

Average of Datediff with a condition

Hi there,

I have a very common business use case which I handled in M/Power Query but I'm struggling to efficiently process it in Dax.

 

I have a list of Jira tickets with start and end dates. I want to know for every month how many Jira tickets were opened and what the average ticket age was at this point in time.

 

For instance, a ticket is opened in March and closed in April, so it should count as open in March with an age on 1 month, April with an age of 2 months and it should not appear any longer in the calculation from May on.

 

The final output will be a time-series with the months in x-axis and the average ticket lifetime and the number of tickets in y-axis.

 

Would you have any clue wrt how to process this business case please ?

 

Thanks in advance,

Nicolas.

1 ACCEPTED SOLUTION
nicplancho
Helper I
Helper I

3 REPLIES 3
nicplancho
Helper I
Helper I

For those looking for an answer, this one is just on point : https://stackoverflow.com/questions/77559058/dax-average-of-datediff-with-condition

devesh_gupta
Super User
Super User

@nicplancho You can refer these videos, these might help you:

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4 
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU


If you find this insightful, please provide a Kudo and accept this as a solution.

Ritaf1983
Super User
Super User

Hi @nicplancho 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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