Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am trying to calculate the date difference between two dates that can only be defined by another column. I have a table with three columns i.e taskname,taskstartdate, taskfinishdate
TaskName TaskStartDate TaskFinishDate
TaskName1 10/08/2017 01/08/2018
TaskName2 01/09/2018 05/04/2018
Now I need the date difference between Taskname1-TaskStartdate and Taskname2-TaskFinishdate so that I can calculate the total duration of the project from start to finish and I can't take the difference of the projectstartdate and projectfinishdate as there might be other tasks associated with the project that are beginning and ending before or after these tasks.
Any help would be apprieciated.
Thanks
Sridhar
Solved! Go to Solution.
Hi,
I tried different ways to calculate the date difference between two diffrent rows of two different colunms but I couldn't for abvious reasons. So we changed the underlying data to reflect that for any given task we shall have the start and the finish date for the corresponding taskname which are associated with the primary key(projectid). Then I can compute the date difference normally. For now this is the alternative workaround for this issue.
Thanks
Sridhar
@Anonymous
Try this Formula:
DATEDIFF(TaskStartDate,TaskFinishDate,Day)
-Hemal
@hemal_kanjia I tried that but the issue I am facing is that I need the datediff between taskname1-taskstartdate and taskname2-taskfinishdate. If I use the above formula it would only give me the date difference between taskname1-taskstartdate and taskfinishdate. I wrote a DAX query but I am not getting any output
Duration_Metric7 = DATEDIFF((IF('Tasks-Metric7'[TaskName]="Taskname2",'Tasks-Metric7'[TaskFinishDate].[Date])),(IF('Tasks-Metric7'[TaskName]="Taskname1",'Tasks-Metric7'[TaskStartDate] .[Date])),DAY)
Please let me know if you can tweak the above formula to compute the difference. Any help would be appreciated.
Hi,
I tried different ways to calculate the date difference between two diffrent rows of two different colunms but I couldn't for abvious reasons. So we changed the underlying data to reflect that for any given task we shall have the start and the finish date for the corresponding taskname which are associated with the primary key(projectid). Then I can compute the date difference normally. For now this is the alternative workaround for this issue.
Thanks
Sridhar
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |