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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KSASSESSMENT
Regular Visitor

Average Calculation With Filter

Hi

 

Wonder if anyone can help.

 

I have a set of results. Basically column A has a list of people, Column B has a list of test names and Column C has a list of scores.

 

I am trying to write a measure that will allow an average score to be shown across all selected test names.

 

The issue I am having at the moment is that the average stays the same even after applying a filter.

Average of Score total for Score =
CALCULATE(AVERAGE('Results'[Score]), ALLSELECTED('Results'[Test Name]))

 

It is showing an average across all test names and if I filter to a specific test name the average score stays the same whereas I would like it to show the average score for that test name.

 

I have a tried so many different options and just can't get this one right.

 

Full NameTest NameScore
Lisa TaylorTest 167
Mark TaylorTest 287
Sam HughesTest 176
Sam TaylorTest 281

 

Can anyone point me in the right direction?

 

Regards

Lisa

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable


Allselected is not the right function.

AverageAllTestname = CALCULATE(AVERAGE(Result[Score]),ALL(Result))
AverageByTestname = CALCULATE(AVERAGE(Result[Score]),ALLEXCEPT(Result,Result[Test Name]))
 
average all and allexcept.JPG

Paul,
Best

View solution in original post

2 REPLIES 2
Anonymous
Not applicable


Allselected is not the right function.

AverageAllTestname = CALCULATE(AVERAGE(Result[Score]),ALL(Result))
AverageByTestname = CALCULATE(AVERAGE(Result[Score]),ALLEXCEPT(Result,Result[Test Name]))
 
average all and allexcept.JPG

Paul,
Best
az38
Community Champion
Community Champion

Hi @KSASSESSMENT 

try 

 

Average of Score total for Score = 
CALCULATE(AVERAGE('Results'[Score]); ALLEXCEPT('Results';'Results'[Test Name]))

ALLSELECTED removes filter from column

ALLEXCEPT removes filters from other column

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors