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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Working Day calculation with condition

Hi There,

I hope you all must be doing great.

I need help in the calculation of the working days between ‘’Planned Planning’’ and ‘’Actual Planning’’ with the condition if the value in ‘’ Delay Planning’’ is more than Zero.

I tried the below formula but don’t know how to add weekend

 

DelayWorkingDays = if('All Projects Query'[Delay planning]>0, 'AllProjects Query'[Actual Planning] - 'All Projects Query'[Planned Planning])*1

BI.JPG

 

 Regards,

Zaid

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

A solution to this scenario requires a date table.

Based on the new date table, create a calculation column to determine whether it is a working day.

is_workday = NOT(WEEKDAY('Table'[Date])in {1,7})

Using the is_workday column, the original table can now include a new calculated column which writes as follows:

DelayWorkingDays = IF('All Projects Query'[Delay Planning]>0,
CALCULATE(
    COUNTROWS ( 'Table'),
    DATESBETWEEN ('Table'[Date],  'All Projects Query'[Planned planning], 'All Projects Query'[Actual Planning]-1 ),
    'Table'[is_workday] = TRUE,
    ALL ( 'All Projects Query' )
))

test_isworkday.PNG

Sample .pbix

 

Best Regards,
Liang
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

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

A solution to this scenario requires a date table.

Based on the new date table, create a calculation column to determine whether it is a working day.

is_workday = NOT(WEEKDAY('Table'[Date])in {1,7})

Using the is_workday column, the original table can now include a new calculated column which writes as follows:

DelayWorkingDays = IF('All Projects Query'[Delay Planning]>0,
CALCULATE(
    COUNTROWS ( 'Table'),
    DATESBETWEEN ('Table'[Date],  'All Projects Query'[Planned planning], 'All Projects Query'[Actual Planning]-1 ),
    'Table'[is_workday] = TRUE,
    ALL ( 'All Projects Query' )
))

test_isworkday.PNG

Sample .pbix

 

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

Anonymous
Not applicable

Thanks a lot, it really helped

Greg_Deckler
Community Champion
Community Champion

Net Work Days? https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/td-p/367362



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I am not able to understand it, can help me to understand it

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.