Forum Discussion
Add Business Days to Date Column with Duration Column
- Anonymous2 years ago
Hi mweyri01 ,
Here's my solution.
1. add 2 calculated column in 'date' table:Working Day = IF ( NOT WEEKDAY ( 'Date'[Date], 2 ) IN { 6, 7 }, TRUE(), FALSE() )Working Day Number = RANKX ( FILTER ( 'Date', 'Date'[Working Day] ), 'Date'[Date], , ASC ) - NOT 'Date'[Working Day]add a calculated column in 'table':
End Date = VAR __rank = RELATED('Date'[Working Day Number]) VAR __working_day_number = __rank + 'Table'[Duration] VAR __result = CALCULATE(MIN('Date'[Date]),FILTER(ALL('Date'),'Date'[Working Day Number] = __working_day_number && 'Date'[Working Day])) RETURN __resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi mweyri01 ,
Here's my solution.
1. add 2 calculated column in 'date' table:
Working Day = IF ( NOT WEEKDAY ( 'Date'[Date], 2 ) IN { 6, 7 }, TRUE(), FALSE() )Working Day Number =
RANKX (
FILTER (
'Date',
'Date'[Working Day]
),
'Date'[Date],
,
ASC
) - NOT 'Date'[Working Day]
add a calculated column in 'table':
End Date =
VAR __rank = RELATED('Date'[Working Day Number])
VAR __working_day_number = __rank + 'Table'[Duration]
VAR __result = CALCULATE(MIN('Date'[Date]),FILTER(ALL('Date'),'Date'[Working Day Number] = __working_day_number && 'Date'[Working Day]))
RETURN
__result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi Anonymous
Thank you for your help! This worked for me.