Forum Discussion

SupaFlyeSnuka's avatar
SupaFlyeSnuka
New Member
6 years ago
Solved

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...
  • edhans's avatar
    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
        Result
    

     

    It just adds 2 days if a saturday, or 1 if a sunday.