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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
trevordunham
Resolver I
Resolver I

Filter table results where responses are both A and B in a column

I have the following sample data:

 

User IDResponse TypeScore

1

a100
1a90
3b100
4a80
4b100
6b70

 

I want to filter the reults and get an average score for User IDs who have a response of type for BOTH A and B.

 

In this case, it would return just two responses, from user 4 and the overall average score for the table would be 90. The idea is to see if users who have responses from both types on average have different scores than the overall group.

 

Any thoughts?

1 ACCEPTED SOLUTION
kpost
Super User
Super User

First I applied a visual-level filter using this measure:

 
visual_level_filter =
var score_a = CALCULATE(COUNTROWS('Table'), 'Table'[Response Type] = "a")
var score_b = CALCULATE(COUNTROWS('Table'), 'Table'[Response Type] = "b")

RETURN
IF (score_a <> 0 && score_b <> 0, 1, 0)

 

vis_filter.PNG

 

This makes the table only show the result for User Id #4.

 

Then I calculated the average of their scores :

 

AVERAGE_SCORE = AVERAGE('Table'[Score])
 
And here's the result.
 
result.PNG

 

See attached .pbix file with the solution.

 

///Mediocre Power BI advice, but it's free///

View solution in original post

2 REPLIES 2
trevordunham
Resolver I
Resolver I

@kpost This worked, thanks!

kpost
Super User
Super User

First I applied a visual-level filter using this measure:

 
visual_level_filter =
var score_a = CALCULATE(COUNTROWS('Table'), 'Table'[Response Type] = "a")
var score_b = CALCULATE(COUNTROWS('Table'), 'Table'[Response Type] = "b")

RETURN
IF (score_a <> 0 && score_b <> 0, 1, 0)

 

vis_filter.PNG

 

This makes the table only show the result for User Id #4.

 

Then I calculated the average of their scores :

 

AVERAGE_SCORE = AVERAGE('Table'[Score])
 
And here's the result.
 
result.PNG

 

See attached .pbix file with the solution.

 

///Mediocre Power BI advice, but it's free///

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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