Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
v-lili6-msft
Community Support
Community Support

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:

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.

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-lili6-msft
Community Support
Community Support

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:

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.
Anonymous
Not applicable

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

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.