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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Trying to get the number of working days between a date range when the date doesn't change.

As you can see below I've created a Calculated WorkDay column.
My test data show the from Status and To Status date range for the four records.
Four changes have been made for the same Item Number. As you can see the first entry didn't record a day but the next three entries did. Is this right I would think that if the date never changes it shouldn't count as a day. I also tried removing the time but got the same results. Any suggestion would be greatly appreciated.

Thanks.

 

 

Test dataTest data

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You need a column like

countrows(filter(addcolumns(calendar('Table'[From Status Date],'Table'[To Status Date],)), "WorkDay", weekday([Date],2)),[WorkDay]<6)

 

How to calculate Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

Please check the following tests.

days = DATEDIFF([From],[To],DAY)
Workday =
CALCULATE (
    COUNT ( 'Date'[Date] ),
    DATESBETWEEN ( 'Date'[Date], 'Table'[From], 'Table'[To] )
)

vzhangti_0-1657617418899.png

Your formula will be one day longer than the date count. You can try the following methods.

Workdays = 
CALCULATE (
    COUNT ( 'Date'[Date] )-1,
    DATESBETWEEN ( 'Date'[Date], 'Table'[From], 'Table'[To] ),
    FILTER ( 'Date', [IsWorkingday] = 1 )
)

vzhangti_1-1657617745585.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

amitchandak
Super User
Super User

@Anonymous , You need a column like

countrows(filter(addcolumns(calendar('Table'[From Status Date],'Table'[To Status Date],)), "WorkDay", weekday([Date],2)),[WorkDay]<6)

 

How to calculate Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Thanks for the update... but if the from status date and To status date never changes how can that be counted as 1 day for each record. I would think that the work day would be 0 days or only one day. I put in your calculation and got for working days.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.