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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.