Forum Discussion
SupaFlyeSnuka
6 years agoNew Member
New Date if Weekend (Convert Weekend date to Next Business day date)
What is up y'all!? I'm at a loss here - and frankly not the best at writing queries in PowerBi. Please help me with this. I have a date column with an "OpenDate" I created a new column with th...
- 6 years ago
You can use this formula:
Next Work Day = VAR WorkdayNumber = WEEKDAY( 'Date'[Date], 2 ) VAR Result = SWITCH( TRUE, WorkdayNumber < 6, 'Date'[Date], WorkdayNumber = 6, 'Date'[Date] + 2, WorkdayNumber = 7, 'Date'[Date] + 1 ) RETURN ResultIt just adds 2 days if a saturday, or 1 if a sunday.
edhans
Community Champion
6 years agoYou can use this formula:
Next Work Day =
VAR WorkdayNumber =
WEEKDAY(
'Date'[Date],
2
)
VAR Result =
SWITCH(
TRUE,
WorkdayNumber < 6, 'Date'[Date],
WorkdayNumber = 6, 'Date'[Date] + 2,
WorkdayNumber = 7, 'Date'[Date] + 1
)
RETURN
Result
It just adds 2 days if a saturday, or 1 if a sunday.