Forum Discussion

twofingertyper's avatar
twofingertyper
Helper III
2 years ago
Solved

Tracking active jobs

Hi all, 

 

I have data around jobs that are used on our systems, and I'd like to plot these out on a line graph, but I'd like to line graph to display when the various jobs started, and then also keep track of how many jobs were active at the time - this is to help identify when numerous jobs overlap and there's a potential pinch point because of it.

 

The data I have is name, start time (date/time) and duration - occasionally due to errors a job can run for over 24 hours, this happens very rarely, but I'd like to put in a failsafe that would capture and report on these rather than ignoring them. 

 

I can plot out how to account for the new jobs, and how to extract the time for the date column, adding the duration to the time to give an end time, etc - but what measures do I need to consider to effectively take into account the active jobs at any time, e.g. something like the example below:

 

JobnameStartDurationActive jobs
abc02/08/2024 10:00:0000:45:001
def02/08/2024 10:30:0000:30:002
ghi02/08/2024 12:00:0000:05:001

 

 

 

  • Step 0: I use your data and a 'Calendar' data below.

     

    Step 1: I edit 'DATA' table on Power Query Editor.

    - After -

     

    Step 2: I make a measure and a graph.

    M_Active Jobs = CALCULATE(SUM([Active jobs 2]),FILTER(ALLSELECTED('Calendar'),'Calendar'[Date Time]<=MAX('Calendar'[Date Time])))

     

     

     

     

4 Replies

  • Step 0: I use your data and a 'Calendar' data below.

     

    Step 1: I edit 'DATA' table on Power Query Editor.

    - After -

     

    Step 2: I make a measure and a graph.

    M_Active Jobs = CALCULATE(SUM([Active jobs 2]),FILTER(ALLSELECTED('Calendar'),'Calendar'[Date Time]<=MAX('Calendar'[Date Time])))

     

     

     

     

  • What's the required granulatity level? Minutes? Seconds?  From your description I assume jobs can cross day boundaries?

     

    The standard approach is to prepare a granularity table and then use cross joins and INTERSECT to capture the time units covered by each job.

     

    Or -you could use a graphical solution with a Deneb bar chart.

     

     

    • twofingertyper's avatar
      twofingertyper
      Helper III

      Thank you for this - the other poster provided a solution that worked, but thank you for responding. 

       

      I had not heard of the INTERSECT command before, but will look into it for future reference.