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
Delt-Joe
New Member

SLA calculation

Hello everyone, i am somwhat new to using power bi and DAX and would love some help.

 

Im trying to use Power bi to calculate the lenght of time a incident call has been open and, whilst taking into acount the time that the SLA timer is running.

what im trying to do is = ([Resolutiontime] hrs/days/months/years - [creationtime] hrs/days/months/years) - (number of working days between these values/5 x 64 hours (which is the numebr of hours the sla timer is pause over the weekend)

 

Any help with how to do this would be amazing!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

You can use DATEDIFF to calculate the duration between your two event times. However, I would think you would need to wrap that in an IF statement to check that the start of the event was before whatever time the SLA timer stops and that its resolution was after the SLA timer started again if you want to subtract the 64 hours.

 

SLADuration = var MyDuration = DATEDIFF([Start],[End],hour)

RETURN
     IF([Start]<("SLA Stop Start") && ([End]>("SLA Stop End"),myDuration - 64, myDuration)

Obviously some psuedo code in there, but that would be the general idea.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

You can use DATEDIFF to calculate the duration between your two event times. However, I would think you would need to wrap that in an IF statement to check that the start of the event was before whatever time the SLA timer stops and that its resolution was after the SLA timer started again if you want to subtract the 64 hours.

 

SLADuration = var MyDuration = DATEDIFF([Start],[End],hour)

RETURN
     IF([Start]<("SLA Stop Start") && ([End]>("SLA Stop End"),myDuration - 64, myDuration)

Obviously some psuedo code in there, but that would be the general idea.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Delt-Joe
New Member

Hi All, im a bit new to using power BI and DAX and i was wondering if anyone would be able to help me out

 

Im trying to generate the time between creation of a call and resolution of call. But our SLA timer only runs during working days and not over the weekend so i need ot subtract that from the calculation.

 

What i was thinking was 

= ([resolutiontime]-[creationtime])-((number of work weeks between the 2 time/dates)/5 x 64 this is the number of hours the sla is paused for)

 

 

Any help would be amazing!

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.