cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Audit Plan - Create Start Date from Due Date

Hi Expert,

 

I am working on an audit plan, and my data set

 

  1. Have - Audit Name, Task Name, End Date(Due Date), FieldWork Date
  2. don't have - Start Date 

Now, every audit has 34 end dates and I need to create a logic from which I can get the start date for that task. Now what I think - Every audit task 2 start date will be the end date of task 1 and task 1 start date will be task 1 due date - 5 days.

 

I am using the logic below, but it is not working and any help is appreciated.

 

Start Date =
VAR Project = 'Audit Milestones'[Audit Name]
VAR TaskStartDate = 'Audit Milestones'[Due Date]
VAR nextTaskDate =
MINX(
FILTER('Audit Milestones', 'Audit Milestones'[Audit Name] = Project
&& 'Audit Milestones'[Due Date] > TaskStartDate
// && 'Audit Milestones'[Due Date] > TaskStartDate//
),
aud
)
Return
IF(ISBLANK(nextTaskDate), TaskStartDate, nextTaskDate)

 

Project NameTask Field Work Start DateDue DateStart Date ( Logic Required)
P1T125/1/2312/1/23T1 Due Date - 5 days
P1T2 25/1/2315/1/23T1 Due Date
P1T3  25/1/2320/1/23T2 Due Date
P1T4 25/1/23 25/1/23= Field Work Start Date
P1T5 10/1/2325/2/23T4 Due Date
P2T130/1/2314/1/23T1 Due Date - 5 days
P2T130/1/2324/1/23T1 Due Date

 

 

 
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @shefalinishad11 

 

You can create a new column with this DAX

Start Date = 
var _previousDueDate = MAXX(FILTER('Table', 'Table'[Project Name]=EARLIER('Table'[Project Name]) && 'Table'[Due Date]<EARLIER('Table'[Due Date])),'Table'[Due Date])
return
IF(ISBLANK(_previousDueDate),'Table'[Due Date]-5,_previousDueDate)

vjingzhang_0-1674108971064.png

 

I don't know why the start date for P1's Task 4 should be the Field Work Start Date in your example. With above DAX, it still uses previous task's Due Date as the start date. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @shefalinishad11 

 

You can create a new column with this DAX

Start Date = 
var _previousDueDate = MAXX(FILTER('Table', 'Table'[Project Name]=EARLIER('Table'[Project Name]) && 'Table'[Due Date]<EARLIER('Table'[Due Date])),'Table'[Due Date])
return
IF(ISBLANK(_previousDueDate),'Table'[Due Date]-5,_previousDueDate)

vjingzhang_0-1674108971064.png

 

I don't know why the start date for P1's Task 4 should be the Field Work Start Date in your example. With above DAX, it still uses previous task's Due Date as the start date. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors