Forum Discussion

MaaPer's avatar
MaaPer
Frequent Visitor
6 years ago
Solved

How to calculate productivity

Dear all, For days I've been trying to find out how to approach a problem and I can't find out where to start looking for the solution and I'm going to this forum to ask if anyone can guide me on ho...
  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi MaaPer ,

     

    First of all, please create a index column in power query editor, then create calculated colmun using following: 

     

     

    Calculated column:

    Time between Units = 
    DATEDIFF (
        [Process started],
        CALCULATE (
            MIN ( 'Table'[Process started] ),
            'Table','Table'[Index] > EARLIER('Table'[Index])
            
        ),
        MINUTE
    )
    Work Segment = 
    "Segment "
        & ROUNDDOWN(CALCULATE (
            DISTINCTCOUNT ( 'Table'[Time between Units] ),
            'Table',
            'Table'[Process finished] < EARLIER ( 'Table'[Process finished] ),
            'Table'[Time between Units] > 10
        ),0) + 1

     

    Then create a new measure:

    Work Time in Segment = DATEDIFF(MIN('Table'[Process started]),MAX('Table'[Process finished]),MINUTE)

     

    Update old measure as following:

    Units/hr in Segment = DISTINCTCOUNT('Table'[Items produced]) / [Work Time in Segment] * 60
    Items = 
    VAR fromTime =
        MIN ( 'TimeDim'[From] )
    VAR toTime =
        MAX ( 'TimeDim'[To] )
        VAR nowTime =
        DATE ( 2020, 3, 24 ) + TIME ( 14, 56, 0 )
    RETURN
    IF( MINUTE ( toTime ) = MINUTE ( nowTime )
                && DATEDIFF ( toTime, nowTime, MINUTE ) <= 60 * 8
                && DATEDIFF ( toTime, nowTime, MINUTE ) >= 0,CALCULATE(DISTINCTCOUNT('Table'[Items produced]),'Table'[Process finished] > fromTime,'Table'[Process finished] <= toTime))
    Effective Work Time = 
    VAR fromTime =
        MIN ( 'TimeDim'[From] )
    VAR toTime =
        MAX ( 'TimeDim'[To] )
    VAR nowTime =
        DATE ( 2020, 3, 24 ) + TIME ( 14, 56, 0 )
    RETURN
        IF (
            MINUTE ( toTime ) = MINUTE ( nowTime )
                && DATEDIFF ( toTime, nowTime, MINUTE ) <= 60 * 8
                && DATEDIFF ( toTime, nowTime, MINUTE ) >= 0,
            CALCULATE (
                SUM ( 'Table'[Time of processing] ),
                'Table'[Process started] >= fromTime,
                'Table'[Process finished] <= toTime
            )
        )

     

     

    If you have any other questions , please kindly ask here and we will try to resolve it.

     

    By the way, PBIX file as attached. 


    Best regards,