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

Processing Utilization Hours per Day | How to correctly visualize?

Hi all -

 

I'm currently vizualzing processing times per day for robots that are being ran. To find the processing time in HOURS, I created this calculated column:

 

Processing Time = IF(JobsDB[jobStart] = BLANK(),BLANK(),
IF(JobsDB[jobEnd] = BLANK(), DATEDIFF(JobsDB[jobStart],JobsDB[queryTime],MINUTE)/60,DATEDIFF(JobsDB[JobStart],JobsDB[jobEnd],MINUTE)/60))
 
So I have a start and end time for every job. If it's blank, it hasn't started yet (then blank), if JobEnd is blank, then it's still running, otherwise just get the date different in minutes/60 of start and end.
 
I then created a date table which is based on those start and end columns like so:
 
dimCalendar =

VAR BaseTable = CALENDAR(MIN(JobsDB[End Date]), MAX(JobsDB[End Date]))
Return
ADDCOLUMNS(
BaseTable,
"Year",YEAR([Date]),
"Month",FORMAT([Date], "MMMM"),
"Month Number", MONTH([Date]),
"Calendar Month",FORMAT([Date],"MMMM YY"),
"Month Year", FORMAT([Date],"YYYY MM"),
"Report Date",FORMAT([Date],"YYYY/MM/DD"))
 
 And I connected this date column to the end date column (for transaction metrics) - But now, I'm trying to accurately show how many hours processing per day. My issue is, there may be sometimes, when a process runs at 10 PM and end at 1 AM.. so that would mean that the visual would show that that Job/transaction ran for 3 hours on that next day. 
 
How do I solve this issue? I'd like to maybe modify the model or create a measure/calc column for processing time that ends at 11:59 before the next day so I can show these results correctly. If anyone has any idea as to how to go about this, I would really apperciate it.

Thank you!
 

 

 

1 REPLY 1
AllisonKennedy
Super User
Super User

This is cross posted in Desktop forum already - please keep all conversation thread in that forum: https://community.powerbi.com/t5/Desktop/How-to-calculate-hours-between-to-DateTimes-amp-show-hours-... 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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