Forum Discussion
Working Day calculation with condition
- 6 years ago
Hi Anonymous ,
A solution to this scenario requires a date table.
Based on the new date table, create a calculation column to determine whether it is a working day.
is_workday = NOT(WEEKDAY('Table'[Date])in {1,7})Using the is_workday column, the original table can now include a new calculated column which writes as follows:
DelayWorkingDays = IF('All Projects Query'[Delay Planning]>0, CALCULATE( COUNTROWS ( 'Table'), DATESBETWEEN ('Table'[Date], 'All Projects Query'[Planned planning], 'All Projects Query'[Actual Planning]-1 ), 'Table'[is_workday] = TRUE, ALL ( 'All Projects Query' ) ))Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
A solution to this scenario requires a date table.
Based on the new date table, create a calculation column to determine whether it is a working day.
is_workday = NOT(WEEKDAY('Table'[Date])in {1,7})Using the is_workday column, the original table can now include a new calculated column which writes as follows:
DelayWorkingDays = IF('All Projects Query'[Delay Planning]>0,
CALCULATE(
COUNTROWS ( 'Table'),
DATESBETWEEN ('Table'[Date], 'All Projects Query'[Planned planning], 'All Projects Query'[Actual Planning]-1 ),
'Table'[is_workday] = TRUE,
ALL ( 'All Projects Query' )
))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Thanks a lot, it really helped