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
YBZ59
Regular Visitor

Keep group average while sliced by individual

Hi,

 

I'm trying to get average by row on a matrix, when I slice by a selected user I get his average (Grade) per P item (row) which is fine,  but I want to add the group average (overallaverage) as well and not have it changed upon slicing, How can I do that?

 

So when I slice I get the user average per item and the overall average of the item itself

 

YBZ59_0-1646641297087.png

 

These are the values on the visualization 

The grade is already set to average

YBZ59_1-1646641329609.png

 

1 ACCEPTED SOLUTION

Hi @YBZ59 ,

 

Try to create a measure like below:

Measure = CALCULATE(AVERAGE('Table'[Grade]),ALLEXCEPT('Table','Table'[Course Name]))

Vlianlmsft_0-1646894987611.pngVlianlmsft_1-1646894994352.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I do not have your sample dataset, so I tried to create a simple one.

I hope you can get an idea.

Please check the below picture and the attached pbix file.

 

Picture1.png

 

 

Avg per group =
VAR newtable =
ADDCOLUMNS (
FILTER ( ALL ( Data ), Data[Group] = MAX ( Data[Group] ) ),
"@groupavg", [Avg per program:]
)
RETURN
IF ( HASONEVALUE ( Data[Group] ), AVERAGEX ( newtable, [@groupavg] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks, but this doesn't seem to work

My data is very simple, I have the course titles and grades of students.

I want to create a matrix with 3 columns, 'Course name', 'grade', and 'average course grade, so when I slice by student name I can get his grade on the course under the 'grade' column and the average course grade under the 'average course grade' column. I am able to get only the grade of the student when I slice and when I remove the slice of course the average of the course is shown (which is ok).

Thank You.

Hi @YBZ59 ,

 

Try to create a measure like below:

Measure = CALCULATE(AVERAGE('Table'[Grade]),ALLEXCEPT('Table','Table'[Course Name]))

Vlianlmsft_0-1646894987611.pngVlianlmsft_1-1646894994352.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.