Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Soparklion
New Member

Tech productivity analysis

My technicians can operate multiple machines at the same time - they are programmable and largely hands-off once they get started.  I want to identify which of my technicians are working at what time and the largest number of machines that they operated over each hour during the day - they get bonuses for productivity.

 

The raw data has a job number, technician ID, machine start time and machine finish time in an Excel file.  In a separate file, I have the technician daily assignment schedule.

 

Is there an easy way to analyze this in Power BI?  Do I need to match the assignment schedule from the 2nd Excel file with the time data from the primary Excel file before the Power BI analysis?

 

Any suggestions are appreciated.

 

 

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

Hi @Soparklion ,

" I want to identify which of my technicians are working at what time"

First, I created two columns:

 

date = FORMAT([Working time], "mm/dd/yyyy")
period = 
VAR x= FORMAT([Working time],"HH:mm:ss")
VAR y= FORMAT([Off time], "HH:mm:ss")
RETURN
COMBINEVALUES("-", x, y)

 

g3.PNG 

Then, I created a measure:

 

Measure 2 = 
IF(
    HASONEFILTER(Sheet2[ Technician ID]),
    VAR x = COUNT(Sheet2[ Technician ID])
    RETURN
    IF(
        x <> 0,
        "T"
    ),
    CALCULATE(
        COUNT(Sheet2[ Technician ID]),
        ALLEXCEPT(
            Sheet2,
            Sheet2[date], Sheet2[period]
        )
    )
)

 

Then, I got this Matrix:

g4.PNG
(used table: sheet2)

 

"the largest number of machines that they operated over each hour during the day"

First, I created one column:

 

date = FORMAT([Working time], "mm/dd/yyyy")

 

g5.PNG

Then, I created one measure:

 

Largest number = 
VAR x =
DATEDIFF(
    MAX(Sheet1[Machine start time]),
    MAX(Sheet1[machine finish time]),
    HOUR
)
RETURN
CALCULATE(
    COUNT(Sheet1[Job number]),
    FILTER(
        Sheet1,
        x >= 1
    )
)
    

 

g6.PNG
(used table: sheet1)

Best regards,
Lionel Chen

 

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

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @Soparklion ,

" I want to identify which of my technicians are working at what time"

First, I created two columns:

 

date = FORMAT([Working time], "mm/dd/yyyy")
period = 
VAR x= FORMAT([Working time],"HH:mm:ss")
VAR y= FORMAT([Off time], "HH:mm:ss")
RETURN
COMBINEVALUES("-", x, y)

 

g3.PNG 

Then, I created a measure:

 

Measure 2 = 
IF(
    HASONEFILTER(Sheet2[ Technician ID]),
    VAR x = COUNT(Sheet2[ Technician ID])
    RETURN
    IF(
        x <> 0,
        "T"
    ),
    CALCULATE(
        COUNT(Sheet2[ Technician ID]),
        ALLEXCEPT(
            Sheet2,
            Sheet2[date], Sheet2[period]
        )
    )
)

 

Then, I got this Matrix:

g4.PNG
(used table: sheet2)

 

"the largest number of machines that they operated over each hour during the day"

First, I created one column:

 

date = FORMAT([Working time], "mm/dd/yyyy")

 

g5.PNG

Then, I created one measure:

 

Largest number = 
VAR x =
DATEDIFF(
    MAX(Sheet1[Machine start time]),
    MAX(Sheet1[machine finish time]),
    HOUR
)
RETURN
CALCULATE(
    COUNT(Sheet1[Job number]),
    FILTER(
        Sheet1,
        x >= 1
    )
)
    

 

g6.PNG
(used table: sheet1)

Best regards,
Lionel Chen

 

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

Anonymous
Not applicable

What do you mean by 'machine start time'? is that just the time or is it a date with a timestamp?


I have a date-time stamp for each, as we work an overnight shift at times.  Thank you!

Anonymous
Not applicable

I think the easiest way to do this is to add a date table. and link both tables with this date table (in Power BI)

datetable.PNG

 

If you don't know what a date table is, or don't know how to create one, this blog probably will help you:

https://kohera.be/blog/power-bi/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/

(note that based on your regional settings, you should use ',' instead of ';' in the dax formula provided.)

 

Let me know if you have any questions.

Thank you for the suggestion.  How can I determine concurrency?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.