This content has been marked as final. Show 3 replies
If I understand correctly, you only need to add a conditional so the expression is only calculated when StopDate is greater than StartDate, so the following should do it:
If(StopDate > StartDate, Date(Date#(StopDate, 'YYYYMMDD'), 'YYYY-MM-DD') - Date(Date#(StartDate, 'YYYYMMDD'), 'YYYY-MM-DD') , 0) as DayDiff // 0 is the default value when StopDate is not greater than StartDate: change it according to your needs
Hope that helps.