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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Converting number to Hours and Minutes in DAX

Hi,

My goal is to find the average resolution time for the incidents. Below are the DAX queries. I am getting incorrect Average resolution time.  The correct average resolution time is 31:57 (HH:MM). My result is 12:05 (HH:MM). Please let me know if I am missing anything here.

 

1. I converted Time coumn to round to the nearest minutes . 

MinutesRoundTotal =
60 *HOUR(Source[To Resolution (Business)]) + MINUTE ( MROUND ( Source[To Resolution (Business)], TIME ( 0, 1, 0 ) ) + TIME ( 0, 0, 0 ) )
 
2. Calculate average and convert it into hours and minutes. ( Considering the tickets that are resolved in the last 30 days)
Medium_Resolution_Timestamp =
Var ART=calculate(AVERAGE(Source[MinutesRoundTotal]),filter(source,Source[Priority]="Medium"),DATESINPERIOD('Source'[Resolved At].[Date],MAX(Source[Resolved At]),-30,DAY))
Var Result=if(isblank(ART),"No Data Available" & UNICHAR ( 10 ) &"Data displayed is: last 30 days since" & " (" & (today()-30) &")"& ". Priority is: Medium ",FORMAT(ART,"HH:MM" )& UNICHAR ( 10 ) & UNICHAR ( 10 ) & "HH:MM")
Return UNICHAR(10)
& Result
 
Thanks,
Radhika
3 REPLIES 3
tamerj1
Super User
Super User

Hi @Radhika_Kanaka 

DATESINPERIOD is a time intelligence function that works only with standard date table that is marked as date table. 

@tamerj1  Thank you for the response. What can I use instead of DATESINPERIOD for calculating average resolution time for the last 30 days (time is based on Resolved At date/Time field.) 

Hi @Radhika_Kanaka 

you may try
'Source'[Resolved At] >= MAX(Source[Resolved At]-30,

'Source'[Resolved At] <= MAX(Source[Resolved At]),

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors