Forum Discussion

masplin's avatar
masplin
Icon for Impactful Individual rankImpactful Individual
7 years ago
Solved

Scratching my head over AVERAGEX

I have a bunch of engineers who get assigned work for each day and I have come up with a scoring system for how well each is utilissed on a particular day. What i woudl like the is overall average sc...
  • v-cherch-msft's avatar
    v-cherch-msft
    7 years ago

    Hi masplin 

    You may create a condition measure.Then get the Eng Day Score with it.

    Condition =
    VAR NewinHours =
        CALCULATE ( [Labour Hours], 'Install Report'[CALL_TYPE] = "NEWIN" )
    RETURN
        IF (
            [Newin Jobs] > 2,
            5,
            IF (
                [Newin Jobs] = 2
                    || AND ( [Newin Jobs] = 1, NewinHours >= 7 ),
                4,
                IF (
                    [Newin Jobs] = 1
                        && NewinHours < 7
                        && [Labour Hours] >= 6,
                    3,
                    IF ( [Labour Hours] > 4, 2, IF ( [Labour Hours] > 0, 1, 0 ) )
                )
            )
        )
    
    Eng Day Score = 
    VAR
    NewinHours=CALCULATE([Labour Hours],'Install Report'[CALL_TYPE]="NEWIN")
                                  
                                
    RETURN
          
              AVERAGEX(
                         SUMMARIZE(
                                  'Install Report',
                                  DateTable[Day],
                                  'Install Report'[ENGINEER]
                                  ),
                    [Condition]
                    )

    Regards,