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

Hiding values in Matrix for lower levels

Hi, I need hel\p with calcualting processing time.

 

I have  SubmissionDateTime  and  DecisionDateTime

 

Now business wants to find all the application processing times with time buckets. How many Hours it took to process excluding Holidays/Weekends defined in DateDim table

Ex: If a Customer submitted application on 02/06/2020 at 3:00 PM (Thursday)
and
accepted on 02/10/2020 11:00 AM

So Totoal Hours for this application will be:

Thursday: 12-3 = 9 Hours (Thursday EOD 11:59 PM) 
Friday: 24 Hours
again it should check for next working day before DecisionDate which is Monday 12 AM - Here Clock stops till next workind day
Monday: 12 AM to 11 AM - 11 Hours

Total: 9 + 24 + 11 = 44 Hours

 

Reports are based on : < 24 Hours, 24-48 Hours, > 48 Hours.

Note: requirement is to consider 24 hours as Working hours on a Working Day.

 

DAX or SQL any solution is works for me.

 

Thanks in advance

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, you could use this way as below:

1. create a total hours column as below:

Total hours = 
DATEDIFF ( [SubmissionDateTime], [DecisionDateTime], HOUR ) - 
24* COUNTROWS (  FILTER (
                'Date',
                'Date'[Date] >= 'Table'[SubmissionDateTime]&& 'Date'[Date] <= 'Table'[DecisionDateTime]
                    && ( 'Date'[Weekday] = 6 || 'Date'[Weekday] = 7 )
            )
        )

You could just add column in DateDim table that if this date is Holidays/Weekends, then use it in formula conditional.

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
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

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, you could use this way as below:

1. create a total hours column as below:

Total hours = 
DATEDIFF ( [SubmissionDateTime], [DecisionDateTime], HOUR ) - 
24* COUNTROWS (  FILTER (
                'Date',
                'Date'[Date] >= 'Table'[SubmissionDateTime]&& 'Date'[Date] <= 'Table'[DecisionDateTime]
                    && ( 'Date'[Weekday] = 6 || 'Date'[Weekday] = 7 )
            )
        )

You could just add column in DateDim table that if this date is Holidays/Weekends, then use it in formula conditional.

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.