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
Anonymous
Not applicable

Calculating Expected Due/Completion Date Time based on SLA & Created Date Time

Hi,

Looking for a help on DateTime Caculation.

I have a table with Unique Tasks Ids and its allocated dateTime and each of it has an SLA in days defined.

I need to create every Task's expected Completion date as per its SLA considering WorkingDays i.e. WeekDays.

The challenge is, eg. 2 Tasks can have same allocated Date Time with different SLA and the expected date time should have time precision. Eg. below;

Thanks !

Task IDAllocate DateTime

SLA Days

Expected_Completion DateTime
210024/01/2020 15:06127/01/2020 15:06
210124/01/2020 15:06531/01/2020 15:06
210228/01/2020 12:05230/01/2020 12:05

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Capture8.PNG

 

QUOTIENT = QUOTIENT(WEEKDAY(Test[Allocate DateTime],1)+Test[SLA Days],7)
Expected End Date = Test[Allocate DateTime]+Test[SLA Days]+2*Test[QUOTIENT]
 
Thanks,
Pravin

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

refer this one

 

https://community.powerbi.com/t5/Desktop/Add-working-days-to-a-date/td-p/146945

 

You need create date table and also you need to identify which one weekday and weekend in date table only and link date table on allocation date.

 

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Anonymous
Not applicable

Try this one as well

 

New column=

var Quotient_=QUOTIENT(WEEKDAY(Test[Allocate DateTime],1)+Test[SLA Days],7)

return

Expected End Date = Test[Allocate DateTime]+Test[SLA Days]+2*Quotient_
 
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.
az38
Community Champion
Community Champion

Hi @Anonymous 

use technique from this thread

https://community.powerbi.com/t5/Desktop/Add-working-days-to-a-date/td-p/146945

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Many thanks for your response @Anonymous !

I have tried that and the only issue is adding the Days to the Rank.

In my case the value "10" is SLA and Dynamic coming from another Table, where the SLA for each datetime in the row.

When I try to add it to the Rank (as the last parameter), it asks for aggrregation, where the output fails, since though the datetime it referes could be same but the SLA are different - (my table example above) !

 

Appreciate your help on it ..

 

Add 10 woring days = LOOKUPVALUE(Canlendar[Date],Canlendar[Identify],1,Canlendar[Rank1],Canlendar[Rank1]+10)

 

az38
Community Champion
Community Champion

@Anonymous 

try something like

+SELECTEDVALUE(YourTable[SLA Days])

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @az38 , Unfortunately SELECTEDVALUE() didnt work !

Any other way you suggest ?

Thanks

az38
Community Champion
Community Champion

@Anonymous 

did you create relationships?

did you try 

Result=RELATED(Calendar[Add 10 woring days])

as mentioned in example?

Add 10 woring days is a column from Calendar table

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

Yes, I have created relationship on the Dates between the Calendar & the Fact [1 : *] .

Also, did all the steps including fetching the related column as a Result  in Fact table.

The issue is Dynamic SLA number (i.e. days) which in the Fact table occuring multiple times for a single date (as in my example).
Need a way to Add SLA as is,  at the step ' Add 10 working day step' without Aggregartion (i.e. Min/ Max)

 

Thanks.

 

 

Anonymous
Not applicable

Capture8.PNG

 

QUOTIENT = QUOTIENT(WEEKDAY(Test[Allocate DateTime],1)+Test[SLA Days],7)
Expected End Date = Test[Allocate DateTime]+Test[SLA Days]+2*Test[QUOTIENT]
 
Thanks,
Pravin
Anonymous
Not applicable

Thanks @Anonymous   It worked perfect !

Anonymous
Not applicable

hi @Anonymous 

 

Did you tried my solution?

 

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

 

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