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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AJW2023
Regular Visitor

Calculate average at different hierarchy levels in Matrix

I am attempting to calculate the average itmes sold across different rows (hierarchy) of a matrix table to then compare to the actual number sold for each month and identify through conditional formating months where the number of items sold were above the average.

 

Example: 

Calulate the average sold per month for 'Site A' (44/12 = 3.67) to then be able to identify the months where 'Site A' sales was above the average.

Then calculate the average sold per month for area 'Blue' (next level of the hierarchy) and identify the months where 'Blue' area items sold were above the average.

 

AJW2023_1-1673575456744.png

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AJW2023 , Assuming you only want to change grand total

 

First, create a measure

M1= Sum(Table[Number sold])

 

Then create and use this measure

m2= Averagex(Values(Table[Month]), [M1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@AJW2023 , Assuming you only want to change grand total

 

First, create a measure

M1= Sum(Table[Number sold])

 

Then create and use this measure

m2= Averagex(Values(Table[Month]), [M1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thats @amitchandak .  That has calculated the averages for each of the rows as I was hoping. 

 

Any ideas how to then compare each months total per cagegory and display if it is greater than the average using conditional formating?

 

For example for "Site A" the average is 3.67 therefore the months where the number sold were greater than the average = January, Feburary, May, July, August and September and highlight these values Red

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.