Hey Community,
I am creating a milestone tracker, and I need little help here:
Project | Task | Task Start Date | Task End Date |
P1 | T1 | 12/2/21 | 15/2/21 |
P1 | T2 | 15/2/21 | 15/2/21 |
P2 | T1 | 12/3/21 | 15/3/21 |
P2 | T2 | 15/3/21 | 20/3/21 |
P2 | T3 | 20/3/21 | 20/3/21 |
I need to work on the DAX function that will automatically calculate the task end date with the next task start, and if the project change, it will consider the task start date as the end date.
Solved! Go to Solution.
Here is an alternative adapted from @amitchandak
EndDate_V2 = VAR project = TableTasks[Project] VAR TaskStartDate = TableTasks[TaskStartDate] VAR nextTaskDate = MINX ( FILTER ( TableTasks, TableTasks[Project] = project && TableTasks[TaskStartDate] > TaskStartDate ), TableTasks[TaskStartDate] ) RETURN IF ( ISBLANK ( nextTaskDate ), TaskStartDate, nextTaskDate )
Here is an alternative adapted from @amitchandak
EndDate_V2 = VAR project = TableTasks[Project] VAR TaskStartDate = TableTasks[TaskStartDate] VAR nextTaskDate = MINX ( FILTER ( TableTasks, TableTasks[Project] = project && TableTasks[TaskStartDate] > TaskStartDate ), TableTasks[TaskStartDate] ) RETURN IF ( ISBLANK ( nextTaskDate ), TaskStartDate, nextTaskDate )
It worked, thank you so much to help.
Here is a tentative solution as a calculated column
EndDate = VAR ProjectID = TableTasks[Project] VAR TaskIndex = RIGHT ( TableTasks[Task], LEN ( TableTasks[Task] ) - 1 ) VAR Result = CALCULATE ( MAX ( TableTasks[TaskStartDate] ), FILTER ( TableTasks, TableTasks[Project] = ProjectID && TableTasks[Task] = "T" & ( TaskIndex + 1 ) ) ) RETURN IF ( ISBLANK ( Result ), TableTasks[TaskStartDate], Result )
Let us know if that works for you
David
@shefalinishad11 , Th logic I applied, If in the smae project I get next date, That will end date of this step, else start date and enddate.
Can you copy paste data from excel. It coming all in one line
@shefalinishad11 , Try a new column like
New column =
var _min= maxx(filter(Table, [project] =earlier([project]) && [Task Start Date] > [Task Start Date] ),[Task Start Date])
return
if(isblank(_min), [Task Start Date] ,_min)
Hi @amitchandak ,
Thanks for looking out.
The column work but it showing the start date in the end date column. It supposed to pick the start date of the next task as the end date for that particular project. If the project last task then the end date should be the same as the start date. Sharing screenshot.
User | Count |
---|---|
136 | |
59 | |
56 | |
55 | |
47 |
User | Count |
---|---|
128 | |
78 | |
55 | |
54 | |
51 |