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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NNaj
Helper IV
Helper IV

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

@NNaj , 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/

 

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@NNaj , 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/

 

 

What would the measure and av measure be?

@NNaj ,

measure = sum(Table[Value])

 

Avg Measure = Average(Table[Value])

or

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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