Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Hems
Frequent Visitor

Adding business days to a date and get date

Hems_0-1683595796962.png

Need to add business days to date and get new date column. Above is the example for the output.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Hems ,

 

I suggest you to create a calendar table to help you achieve your goal.

My Sample:

vrzhoumsft_0-1683799208568.png

vrzhoumsft_1-1683799232854.png

Calendar:

Calendar = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "WeekDay", WEEKDAY ( [Date], 2 ),
    "Flag",
        VAR _WEEKDAY =
            WEEKDAY ( [Date], 2 )
        RETURN
            IF (
                [Date] IN VALUES ( Holidays[Holidays] ),
                "Holiday",
                IF ( _WEEKDAY IN { 6, 7 }, "Weekend", "Business Day" )
            )
)

Add a calcualted column in calendar table.

Rank = RANKX(FILTER('Calendar','Calendar'[Flag] = "Business Day"),[Date],,ASC)

Then add a calculated column in your table.

Need Output = 
CALCULATE (
    MAX ( 'Calendar'[Date] ),
    FILTER (
        'Calendar',
        'Calendar'[Flag] = "Business Day"
            && 'Calendar'[Rank]
                = RELATED ( 'Calendar'[Rank] ) + 'Table'[SLA]
    )
)

Result is as below.

vrzhoumsft_2-1683799325367.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Hems ,

 

I suggest you to create a calendar table to help you achieve your goal.

My Sample:

vrzhoumsft_0-1683799208568.png

vrzhoumsft_1-1683799232854.png

Calendar:

Calendar = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "WeekDay", WEEKDAY ( [Date], 2 ),
    "Flag",
        VAR _WEEKDAY =
            WEEKDAY ( [Date], 2 )
        RETURN
            IF (
                [Date] IN VALUES ( Holidays[Holidays] ),
                "Holiday",
                IF ( _WEEKDAY IN { 6, 7 }, "Weekend", "Business Day" )
            )
)

Add a calcualted column in calendar table.

Rank = RANKX(FILTER('Calendar','Calendar'[Flag] = "Business Day"),[Date],,ASC)

Then add a calculated column in your table.

Need Output = 
CALCULATE (
    MAX ( 'Calendar'[Date] ),
    FILTER (
        'Calendar',
        'Calendar'[Flag] = "Business Day"
            && 'Calendar'[Rank]
                = RELATED ( 'Calendar'[Rank] ) + 'Table'[SLA]
    )
)

Result is as below.

vrzhoumsft_2-1683799325367.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.