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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Jaweed
Helper III
Helper III

Show Either Total or Average in Matrix Total

Hi Friends

I am seeking your valuable assistance.

 

I am able to design a matrix in powerbi, with totals showing properly at required hierarchy levels. My problem is that for some columns, I need to do a SUM in the Total row,  while for others I need to calulate the average instead. Examples, for Revenue it makes sense to get the Total while for % Profit, the 'Total' should show the AVERAGE of the rows.

I attach a sample Test data with the desired output of the matrix. In the sample data, when column [Unit of Measure] = Units, I need to sum, when the column = %, then I need to average. 

Thank you for your help. 

 

CompanyMonthMetricValueUnit of Measure 
CPYA24-JanRevenue20000Units 
CPYA24-Jan% Profit60% 
CPYA24-JanNo of Complaints3Units 
CPYA24-Jan% Leavers6% 
      
CPYB24-JanRevenue25000Units 
CPYB24-JanPercentage  Profit30% 
CPYB24-JanNo of Complaints6Units 
CPYB24-Jan% Leavers4% 
      
      
CPYA24-FebRevenue10000Units 
CPYA24-Feb% Profit20% 
CPYA24-FebNo of Complaints2Units 
CPYA24-Feb% Leavers8% 
CPYB24-FebRevenue12000Units 
CPYB24-Feb% Profit10Percentage 
CPYB24-FebNo of Complaints1Units 
CPYB24-Feb% Leavers2% 
      
      
Desired output in Matrix     
  Revenue% ProfitNo of Complaints% Leavers
Consolidated 6700030125
CPYA24-Jan200006036
 24-Feb100002028
 Total/Average300004057
CPYB24-Jan250003064
 24-Feb120001012
 Total/Average370002073
      
Grand Total 6700030125
1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1713667308858.png

 


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

Helpful resources

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

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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