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
JFG1234
Frequent Visitor

Calculate benchmark average with filter by group

I am trying to add a field called "Benchmark" to the visual below (left).

The "Benchmark" field needs to be separated by Sex as can be seen in the right table (female = 11, male = 11.88).

 

The final output should be the first left table with "Benchmark" added; when female = 11 and when male 11.88.

 

 

JFG1234_4-1674179352918.png

 

When I add the field I have created it expands out the table and creates a series of empty records (i.e. Count of Year with blank values), but gets the benchmark correct.

 

JFG1234_3-1674179336448.png

 

This is the calculation I am using the calculate the benchmark. It should take the average of performance "Points" where the "Rank" is = 3 and account for Sex.

 

JFG1234_1-1674179294896.png

 

This is the model schema.

 

JFG1234_5-1674179413663.png

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@JFG1234 , Try Measure like

 

calculate(Average(Table[Points]), filter(allselected(Table) , Table[Rank] = 3 && Table[Sex]=max(Table[Sex])))

Sex isn't in the same table as Points, it is connected by a many:1 relationship through the Athlete_ID as the last picture shows. Is it possible to do through the relationship?

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.

Top Solution Authors