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
Anonymous
Not applicable

Duration and null dates relative to today, excluding weekends

Hi all,

 

Context: Cases must be acknowledged within 2 business days.

Criteria 1: If a case has been open for more than 2 days with no acknowledge date, it is overdue.

Criteria 2: If a case has an acknowldge date of +2 days from the created date, it is overdue.

So I would like to count all cases where the acknowledge date is either +2 days from the created date, or the created date is +2days old and the acknowledge date is blank. The count must also exclude weekends.

 

Attempt:

Criteria 1: I tried adding a conditional column in Power Query where each if [Age] >2 and [Local Ack Date] = null then 1 else 0 but this does not account for weekends

 

Critera 2: This DAX formula counts the business days between Created and Acknowledged using a secondary date table, but if there is no "Acknowledged Date", the field is blank

 

Days to Ack =
SUMX (
    FILTER (
        'Date',
        'Date'[Date]>= 'CRM Cases All'[Local Created Date]
            && 'Date'[Date]<= 'CRM Cases All'[Local Ack Date]
    ),
    'Date'[AddBusinessDayInd]
)
 
Need: So I'm looking for help solving Criteria 1, identify cases where the created date is older than 2 days (not including today, excluding weekends) with no acknowledge date. Would love any ideas 🙂
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a calculated column like

Is overdue =
ISBLANK ( 'CRM Cases All'[Local Ack Date] )
    || NETWORKDAYS (
        'CRM Cases All'[Local Created Date],
        'CRM Cases All'[Local Ack Date]
    ) > 2

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could create a calculated column like

Is overdue =
ISBLANK ( 'CRM Cases All'[Local Ack Date] )
    || NETWORKDAYS (
        'CRM Cases All'[Local Created Date],
        'CRM Cases All'[Local Ack Date]
    ) > 2
Anonymous
Not applicable

Hi @johnt75 thanks so much, this has solved it. I'm new to DAX and didn't realise there was an "or" expression ( || ). Thanks a lot!

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