Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Calculate average for each main category

I have tried to calclate the Average Used Megabytes for each disk but please see below the output. I would like to calculate the Average Used Megabytes for Server A and Disk C = ? and similarly for o...
  • v-lili6-msft's avatar
    7 years ago

    HI, Anonymous 

    You could use EARLIER Function in your formula to get it.

    Result = 
    CALCULATE (
        AVERAGE ( 'Disk Space DW'[Used Megabytes] ),
        FILTER (
            'Disk Space DW',
            'Disk Space DW'[Computer Name] = EARLIER ( 'Disk Space DW'[Computer Name] )
                && 'Disk Space DW'[Disk] = EARLIER ( 'Disk Space DW'[Disk] )
        )
    )

    Result:

     

    Best Regards,

    Lin