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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.