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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
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.

Top Solution Authors
Top Kudoed Authors