cancel
Showing results for
Did you mean:
Highlighted
Member

## 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 other servers and disks. Please help.

 Computer Name Disk Total Megabytes Used Megabytes Average of Used Megabytes Server A C: 75857.92 66733.4 66733.4 Server A C: 75868.16 66709.42 66709.42 Server A C: 75868.16 66711.86 66711.86 Server A C: 75868.16 66720.98 66720.98 Server A C: 75868.16 66728.63 66728.63 Server A C: 75878.4 66740.71 66740.71 Server A C: 75878.4 66755.84 66755.84 Server B C: 75868.16 16626.96 16626.96 Server B C: 75868.16 16629.83 16629.83 Server B C: 75868.16 26687.31 26687.31 Server B C: 75868.16 36690.27 36690.27 Server B C: 75868.16 40703.07 40703.07 Server B C: 75878.4 26687.31 26687.31

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Calculate average for each main category

HI, @vtechzpbi

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

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Community Support Team

## Re: Calculate average for each main category

HI, @vtechzpbi

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

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User

## Re: Calculate average for each main category

Hi,

Why do you want to write a calculated column formula.  To your Table/Matrix visual, drag Computer Name and Disk Fields and write this measure

Measure1 = AVERAGE(Data[Used Megabytes])

Hope this helps.

Member

## Re: Calculate average for each main category

Thanks for replying.. Is it possible to add a column to show Previous Day Used Megabytes for each date...?

Super User

## Re: Calculate average for each main category

Hi,

Assuming you want a calculated column formula solution, try this

=CALCULTE(SUM(Data[Used Megabytes]),FILTER(Data,Data[Computer Name]=EARLIER(Data[Computer Name])&&Data[Reported Date]<EARLIER(Data[Reported Date])))

Ensure that then entries in the Reported Date column are actual Date/Time entries.

Hope this helps.

Announcements

Power BI Super User, Greg Deckler, explains

#### Power Platform Summit North America

Register by September 5 to save \$200

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 40 members 910 guests
Recent signins: