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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AW1976NOVA
Post Patron
Post Patron

Add Column: Calculate Business Days Between 2 dates in the same table

Hi,

 

I have a table that I need to add a column to the will return the number of business days between 2 days.  Here is an example of the data.

 

Claim Number       Date Received     Date Adjudicated

0001                       1/1/2022             1/5/2022

2323                       2/5/2022             2/6/2022

7676                       3/1/2022             3/10/2022

 

I do not require a Calendar Table in this situation.  I just need the numerical value of the business days returned for each row of data in the table.

 

 

 

Thank you

1 ACCEPTED SOLUTION
AW1976NOVA
Post Patron
Post Patron

Days Between WD = COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( 'Claim_Data_Append'[Received Date], 'Claim_Data_Append'[Adjudicated_Date] ), "Day of Week", WEEKDAY ( [Date], 2 ) ), [Day of Week] <> 6 && [Day of Week] <> 7 ) )

 

 

Got this to work for me

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @AW1976NOVA ,

 

Thanks for your reply. If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Best Regards,
Henry

AW1976NOVA
Post Patron
Post Patron

Days Between WD = COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( 'Claim_Data_Append'[Received Date], 'Claim_Data_Append'[Adjudicated_Date] ), "Day of Week", WEEKDAY ( [Date], 2 ) ), [Day of Week] <> 6 && [Day of Week] <> 7 ) )

 

 

Got this to work for me

Samarth_18
Community Champion
Community Champion

Hi @AW1976NOVA ,

 

Please try this:-

business_day = 
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            CALENDAR (
                [Date Received],
                [Date Adjudicated]
            ),
            "Day of Week", WEEKDAY ( [Date], 2 )
        ),
        [Day of Week] <> 6
            && [Day of Week] <> 7
    )
)

 

I have considered Saturday and Sunday as holiday in my calculation.

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors