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
fabd
Helper I
Helper I

Average day for incident resolution

Hi,

I haven't practice for several years.. I must admit that i lost everything, and i am unable to do what i need.

 

So, what i want ?

 

My boss give me a new responsability : KPI for my team ! 😞

 

I create a dataset with some Service Now query to get the state of incident and i would like to know in how many time incident are solved.

 

To do this, i have 2 inputs :

- date open

- date close

 

and i create a new column called duration

 

 

 

 

Duree = SUMX(incident_STI_indus, DATEDIFF(incident_STI_indus[date_creation],incident_STI_indus[date_fermeture],SECOND))

 

 

 

 

 
It works fine. I get, for all incident, the delai in second for resolution.
 
But i would like to have a single KPI Metric, which will says :
2 days, 3 hours, 5 min
 
I have no idea how to deal with.
 
Is there someone who can drive me ?
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @fabd ,

 

Please create the new column:

 

Duree = 
DATEDIFF (
    incident_STI_indus[date_creation],
    incident_STI_indus[date_fermeture],
    MINUTE
)

 

Then create the measure:

 

Measure = 
VAR AveDur =
    AVERAGE ( incident_STI_indus[Duree] )
VAR Days =
    INT ( AveDur / 60 / 24 )
VAR Hours =
    INT ( AveDur / 60 - Days * 24 )
VAR Minutes =
    ROUND ( MOD ( AveDur, 60 ), 0 )
VAR DaysText =
    IF ( Days >= 1, FORMAT ( Days, "General Number" ) & " days" )
VAR HoursText =
    FORMAT ( Hours, "General Number" ) & " hours"
VAR MinutesText =
    FORMAT ( Minutes, "General Number" ) & " min"
RETURN
    COMBINEVALUES ( ", ", DaysText, HoursText, MinutesText )

vkkfmsft_0-1646275517556.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @fabd ,

 

Please create the new column:

 

Duree = 
DATEDIFF (
    incident_STI_indus[date_creation],
    incident_STI_indus[date_fermeture],
    MINUTE
)

 

Then create the measure:

 

Measure = 
VAR AveDur =
    AVERAGE ( incident_STI_indus[Duree] )
VAR Days =
    INT ( AveDur / 60 / 24 )
VAR Hours =
    INT ( AveDur / 60 - Days * 24 )
VAR Minutes =
    ROUND ( MOD ( AveDur, 60 ), 0 )
VAR DaysText =
    IF ( Days >= 1, FORMAT ( Days, "General Number" ) & " days" )
VAR HoursText =
    FORMAT ( Hours, "General Number" ) & " hours"
VAR MinutesText =
    FORMAT ( Minutes, "General Number" ) & " min"
RETURN
    COMBINEVALUES ( ", ", DaysText, HoursText, MinutesText )

vkkfmsft_0-1646275517556.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

coskuersanli
Resolver III
Resolver III

Hi

 

thanks ! great !

i have now the duration in days, hours, min for each incident

 

How i could make an average of the whole column?

 

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!

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.