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
Anonymous
Not applicable

Adding an average column to a matrix

Hi All, I have the following matrix

Row: Group name (A, B, C, D)

 

Columns: Company Name ( Apple, Google, Tesla). HERE I want to add an average column.

 

Values: Any numbers

 

GroupAppleGoogleTeslaAVERAGE
A123 
B232 
C343 
D451 

 

I want to add an average column that looks at te average for the companies selected. How can I do this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , isinscope can help, Make sure you have measure and Avg Measure then

a measure like

if(isinscope(Table[group]) && not(isinscope(Table[Company])), [Avg Measure], [measure])

 

Add column subtotal in matrix, this should give avg in column sub total
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

 

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

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , isinscope can help, Make sure you have measure and Avg Measure then

a measure like

if(isinscope(Table[group]) && not(isinscope(Table[Company])), [Avg Measure], [measure])

 

Add column subtotal in matrix, this should give avg in column sub total
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

 

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
Anonymous
Not applicable

What would the measure and av measure be?

@Anonymous ,

measure = sum(Table[Value])

 

Avg Measure = Average(Table[Value])

or

Avg Measure = Divide(sum(Table[Value]), distinctcount(Table[Company]))

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
Anonymous
Not applicable

Hi Amit. this is working now however the sub-total is s

NNaj_0-1609854938430.png

 

howing the sum and not the average

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.