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
ArchStanton
Impactful Individual
Impactful Individual

Calculating Working Days between multiple events

Hi,

I would like to calculate the Working Days only for a Case between Received and Resolved dates. This is easy if it was just that simple because occasionally a Case can be put on hold (deferred) for several days or weeks, and in the example I have provided, ID 4 was deferred twice = 

 

Deferred Start    Deferred End Date

10/10/2022       - 24/10/2022

14/11/2022       - 29/12/2022

 

I would like to exclude any deferral Days from the overall Working Day calculation.

 

My date table has 2 columns to say whether a date is a Working Day, 1 = True & 0 = False, and a Binary TRUE/FALSE Column.

When I tried doing this I kept getting error messages referring to both of these columns.

 

Can someone write a measure that calculates the Total Case Length in working days only for all 4 Test IDs please? Please exclude the Deferral days from the measure.

I have been struggling with the deferral part for months.

 

I have uploaded a pbix file here:

 

https://ufile.io/g2wuldxo

 

 

Any help would be greatly appreciated.

Thanks!

 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1678224689294.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

5 REPLIES 5
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1678224689294.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Hi,

Quick question, there have been a few occurences where there are even more Deferred Start & End Dates, I have one with 4 different dates so 4 rows in the deferral table. Is it possible to modify this code to COUNTROWS of each ID to factor in these multiple scenarios?

The code works just fine with 2 row as per example you have provided, its just falls down when there are more than 2.

Thanks

This is exactly what I needed, thank you so much!!!

YukiK
Impactful Individual
Impactful Individual

You can get working days like this:

CALCULATE(
    COUNTROWS ( 'Date2' ),
    DATESBETWEEN ( 'Date2'[Date],  'Cases'[Date Received], 'Cases'[Date Resolved] ),
    'Date2'[Is Working Day?] = TRUE,
    ALL ( Date2 )
)
ArchStanton
Impactful Individual
Impactful Individual

This isn't what I was after as I already have this code. The other respondent in this thread has nailed it so all good now.

Thanks for your input anyway!

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