Forum Discussion

ConnieMaldonado's avatar
ConnieMaldonado
Icon for Responsive Resident rankResponsive Resident
4 years ago
Solved

Display calculation in table at higher level than data grain

Hello!  I am calculating efficiency rates for field technicians who travel onsite to a client's home to perform various tasks.  The grain of my data is part number, and I essentially have data by dat...
  • v-zhangti's avatar
    4 years ago

    Hi, ConnieMaldonado 

     

    You can try the following methods.

    Column:

    Onsite Efficiency =
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Expected Duration Hours] ),
            FILTER ( 'Table', [Work Order ID] = EARLIER ( 'Table'[Work Order ID] ) )
        ),
        DIVIDE (
            CALCULATE (
                SUM ( 'Table'[Geofenced Duration Hours] ),
                FILTER ( 'Table', [Work Order ID] = EARLIER ( 'Table'[Work Order ID] ) )
            ),
            CALCULATE ( COUNT ( 'Table'[Work Order ID] ), ALLSELECTED () )
        )
    )
    

     

    Measure:

    Measure = 
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Expected Duration Hours] ),
            FILTER (
                ALL ( 'Table' ),
                [Work Order ID] = SELECTEDVALUE ( 'Table'[Work Order ID] )
            )
        ),
        DIVIDE (
            CALCULATE (
                SUM ( 'Table'[Geofenced Duration Hours] ),
                FILTER (
                    ALL ( 'Table' ),
                    [Work Order ID] = SELECTEDVALUE ( 'Table'[Work Order ID] )
                )
            ),
            CALCULATE ( COUNT ( 'Table'[Work Order ID] ), ALLSELECTED () )
        )
    )

    Does this meet your desired outcome?

     

    Best Regards,

    Community Support Team _Charlotte

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