cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vtechzpbi Member
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 NameDiskTotal MegabytesUsed MegabytesAverage of Used Megabytes
Server AC:75857.9266733.466733.4
Server AC:75868.1666709.4266709.42
Server AC:75868.1666711.8666711.86
Server AC:75868.1666720.9866720.98
Server AC:75868.1666728.6366728.63
Server AC:75878.466740.7166740.71
Server AC:75878.466755.8466755.84
Server BC:75868.1616626.9616626.96
Server BC:75868.1616629.8316629.83
Server BC:75868.1626687.3126687.31
Server BC:75868.1636690.2736690.27
Server BC:75868.1640703.0740703.07
Server BC:75878.426687.3126687.31

 

Capture1.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
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:

1.JPG

 

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
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:

1.JPG

 

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
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.

vtechzpbi Member
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
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.

Helpful resources

Announcements
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 40 members 910 guests
Please welcome our newest community members: