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

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
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.