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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Use working days table to calculate working days between two fields in a measure?

I have a working days table that identifies every date that is a working day, shown below:

 

jsauerla_0-1613992424384.png

 

What I want to do is create a measure that calculates difference in working days of Effective Date and Status Change Date, the two columns shown below

 

jsauerla_1-1613992541410.png

 

A simple DATEDIFF function would allow me to subtract the two... But I have no idea how to check each one if it's a working day. 

 

1 ACCEPTED SOLUTION
Payeras_BI
Solution Sage
Solution Sage

Hi @Anonymous ,

In case you are looking for a Calculated Column you can refer to this method.

 

YourTable[DiffWorkingDays] =
CALCULATE(
    COUNTROWS ( 'Date'),
    DATESBETWEEN ( 'Date'[Date],  YourTable[Effective Date], YourTable[Status Change Date] - 1 ),
    'Date'[Working day] = 1,
    ALL ( 'Date' )
)

 

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

4 REPLIES 4
Payeras_BI
Solution Sage
Solution Sage

Hi @Anonymous ,

Did you copy or type the code?

Make sure your minus sign is "-" and not "–". This could be the issue here.

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Payeras_BI
Solution Sage
Solution Sage

Hi @Anonymous ,

In case you are looking for a Calculated Column you can refer to this method.

 

YourTable[DiffWorkingDays] =
CALCULATE(
    COUNTROWS ( 'Date'),
    DATESBETWEEN ( 'Date'[Date],  YourTable[Effective Date], YourTable[Status Change Date] - 1 ),
    'Date'[Working day] = 1,
    ALL ( 'Date' )
)

 

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Anonymous
Not applicable

Hi @Payeras_BI -- this results in error:

 

The following syntax error occurred during parsing: Invalid token, Line 4, Offset 158, –

 

The subtraction seems to be breaking it

Anonymous
Not applicable

Slicer on date where you select the date range 

Then sum of the column working days

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors