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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Filter for a Field with Multiple Values per User

I'm working on a dataset with survey responses and building a number of filters based on the user responses. Respondent data, answer data, answer options data, and questions data are all in their own tables, with IDs used to link them together.

 

DataModel.PNG

 

The relevant tables here are answers and respondents.

 

In two of the questions, multiple options can be chosen. In this case, each RespondentId has multiple rows in the answers table, one for each answer.

 

AnswersTable.PNG

 

I'm trying to create a filter that would list all the chosen sports (excluding the open text field seen on row 4 above) and filter the charts based on the sports selected. So if you'd select either Yoga or Golf from the filter, the graphs would show the answers for user 38366134, and anyone else who had chosen those sports.

 

I've had no issues creating these filters for questions where each user has a single answer (essentially I've been adding columns to the respondents table with appropriate data), but with these multiple choice ones I'm stuck.

 

I have done a measure 

 

SportsDone = CALCULATE(VALUES(answers[AnswerText]), FILTER(answers, 'answers'[QuestionId] = 672894))

 

, but haven't been able to figure out a way to actually put this into use.

 

Any tips?

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

First  create a slicer table as below:

 

 

slicer table = VALUES('Table'[QuestionId])

 

 

Then create a measure as below:

 

 

Measure = 
var _tab=CALCULATETABLE(VALUES('Table'[Answer Text]),FILTER(ALL('Table'),'Table'[QuestionId]=SELECTEDVALUE('slicer table'[QuestionId])))
Return
IF(MAX('Table'[Answer Text]) in _tab,MAX('Table'[Answer Text]),BLANK())

 

 

And you will see:

 

v-kelly-msft_1-1615879314122.png

 

 

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

First  create a slicer table as below:

 

 

slicer table = VALUES('Table'[QuestionId])

 

 

Then create a measure as below:

 

 

Measure = 
var _tab=CALCULATETABLE(VALUES('Table'[Answer Text]),FILTER(ALL('Table'),'Table'[QuestionId]=SELECTEDVALUE('slicer table'[QuestionId])))
Return
IF(MAX('Table'[Answer Text]) in _tab,MAX('Table'[Answer Text]),BLANK())

 

 

And you will see:

 

v-kelly-msft_1-1615879314122.png

 

 

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

amitchandak
Super User
Super User

@Anonymous , I am not very clear with question.

Count of question for which all users have given same answer(free text is not removed)

 

a new measure 

countx(filter(summarize(answers, 'answers'[QuestionId] , calculate(countdistinct(answers[AnswerText]))), [_1]=1),[QuestionId])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.