Forum Discussion
Calculating Difference Between Two Dates using Multiple If statements
if this
Custom Column -> Latest Package Delay = if List.Max({[PKG.1_DATE2], [PKG.2_DATE2]}) = 0 then null else List.Max({[PKG.1_DATE2], [PKG.2_DATE2]})
works, I suspect the column type [PKG.....] is not date.
Then the error that probably raises the following expression.
Could you give some example of the input table and the expected ouput table?
- Anonymous6 years agoNot applicable
Anonymous Thanks again for your help.
The expected output table for column "Schedule Delay" should be a value for the number of weeks delayed.
Input Table
- Anonymous6 years agoNot applicable
and the input table is ...
you should give only some fictitious examples of the data you manage.
Is important know the number, the order and the name on the columns involved; the tipical case you wanto to treat:
For example if you have the max you are looking for in two differente pkg, which pkg we should considere to calculate the delay.
etc etc..
- Anonymous6 years agoNot applicable
Anonymous
Input Table
Date 2 for each package is a revised date. I want to pick the latest revised date and calculate the date difference (in weeks) between the revised date (date 2) and the initial planned date (date 1).
For example, in the input above the difference in PKG.1_Date2 and PKG.1_Date1 is 2. However, since PKG.2_Date2 is the furthest date out, I want to choose that as my baseline and calculate the date difference (in weeks) between the PKG.2_Date2 and PKG.2_Date1. Since there is nothing for PKG.3_Date1 and PKG.3_Date2 in this case, it will not impact the result. However, if there was a date for it, then it may impact the result.