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

Using date table with weekend and bank holidays to accurately measure "ticket open" day KPIs

Hi all,

 

Bit of a tricky one here.

 

I've created a date table from 2019-2021, which includes a Y/Blank on working days so I can figure out the total days a ticket is open, by minusing two dates against each other. To make this accurate, I need to use this date table to not count the weekends and bank holidays in the year. 

 

So a rough idea of what I'm trying to achieve will be:

 

 "Complaint Received" (complaints table) minus "Final Response Sent" (complaints table), ignoring blanks in "Working Day" (date table). 

 

image.png

Date table featuring weekend and bank holiday info^ 

 

image.png

Complaints recieved column and table (underlined) needed for DAX^

 

image.png

"Final Response Sent" column and table (underlined) needed for DAX ^ 

 

Kind regards,

 

Jordan 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

You can add it as a calculated column to your complaints table like so.

Working Days =
        CALCULATE (
            COUNTROWS ( DateTable ),
            DATESBETWEEN ( DateTable[Date], 'MGA - Complaints (SCANS)[Complaint Received], 'MGA - Complaints (SCANS)[Finla Response Sent] ),
            DATES[Working Day] = 'Y'
        ) -1

The pattern is from this article: https://www.sqlbi.com/articles/counting-working-days-in-dax/ 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you both! @jdbuchanan71 @amitchandak 

jdbuchanan71
Super User
Super User

@Anonymous 

You can add it as a calculated column to your complaints table like so.

Working Days =
        CALCULATE (
            COUNTROWS ( DateTable ),
            DATESBETWEEN ( DateTable[Date], 'MGA - Complaints (SCANS)[Complaint Received], 'MGA - Complaints (SCANS)[Finla Response Sent] ),
            DATES[Working Day] = 'Y'
        ) -1

The pattern is from this article: https://www.sqlbi.com/articles/counting-working-days-in-dax/ 

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.