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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
v_mark
Helper V
Helper V

Monthly Average Tickets Age in Hours

I'm sorry to bother you during the weekend. I've been trying to figure this business requirement out. 
The intent is to get the Monthly Average in hours based on 

1. Average age that are not Closed

2.  Average age that are Closed

 

and use a line chart to indicate the two measures. Similar to the view below. Don't worry about the Month's Initial I can do it. 

v_mark_0-1639173647411.png

 

Duration (Hrs) = 
VAR blankclosedates = DATE(1900,1,1) 
VAR diffhrs = If('Sample Data'[ClosedDateTime] = blankclosedates, BLANK(),
DATEDIFF('Sample Data'[CreatedDateTime], 'Sample Data'[ClosedDateTime], HOUR))
RETURN diffhrs


///// Looks like simple average will not work 

Average Hourly = AVERAGE('Sample Data'[Duration (Hrs)] )

 

 

I do have my date table set up inside my model. 
Any ideas on how to approach this type of issue?  TIA

Sample Pbix file 

 

 

 

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @v_mark ,

 

Create a month column.

Month = FORMAT('Sample Data'[Date],"MMMM")

Then create measures.

_closed = CALCULATE(AVERAGE('Sample Data'[Duration (Hrs)]),FILTER(ALLEXCEPT('Sample Data','Sample Data'[Month]),'Sample Data'[Status]="closed"))

not_closed = CALCULATE(AVERAGE('Sample Data'[Duration (Hrs)]),FILTER(ALLEXCEPT('Sample Data','Sample Data'[Month]),'Sample Data'[Status]<>"closed"))

Capture.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @v_mark ,

 

Create a month column.

Month = FORMAT('Sample Data'[Date],"MMMM")

Then create measures.

_closed = CALCULATE(AVERAGE('Sample Data'[Duration (Hrs)]),FILTER(ALLEXCEPT('Sample Data','Sample Data'[Month]),'Sample Data'[Status]="closed"))

not_closed = CALCULATE(AVERAGE('Sample Data'[Duration (Hrs)]),FILTER(ALLEXCEPT('Sample Data','Sample Data'[Month]),'Sample Data'[Status]<>"closed"))

Capture.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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