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
Craines
Helper II
Helper II

Sum of averages in Matrix using variables in a measure

Hi, I'm sure there should be a simple solution to this, but I haven't managed to find it as yet.

 

I want to create a table where the averages calculated at a course level are summed at a subject, and at a Faculty level, as opposed to the calculation occurring at each level.

 

As an example, the data currently looks like this, where the first column is Year1 based on a measure, the second column Year2 based on another measure, and the third column is the average using a measure DIVIDE( ( [Year1] + [Year2] ), 2):

Craines_0-1685108104896.png

 The bold total in the third column is the Subject, with others being Courses within that Subject.  What I would like is to see the Subject total be 31 - the sum of the averages within the courses in the subject area - rather than the averages of the totals for the subject.

 

Any help much appreciated!

 

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=SUMX(VALUES(DATA[Courses]),[Measure 3])

Hope this helps.


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

Think like the Grand Total. Very often measures designed for the Grand Total will also work for the Row and Column Totals and for the individual cells.

 

Use SUMX over the current filter context. While that is overkill for the individual rows, it will still work, and it will also work for the row total.

 

 

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.