Forum Discussion
Survey analysis: selection/filtering respondents based on responses
- Anonymous2 years ago
Thanks for the reply from ray_aramburo , please allow me to provide another insight:
Hi, Anonymous
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Then I created a calculation table like this, and used it as a slicer:
select111 = SELECTCOLUMNS('Table','Table'[question],'Table'[response])3. Below are the measure I've created for your needs:
MEASURE = VAR response1 = SELECTEDVALUE ( 'select111'[Table_response] ) VAR ques1 = SELECTEDVALUE ( 'select111'[Table_question] ) VAR ID1 = CALCULATETABLE ( VALUES ( 'Table'[ID] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[question] = ques1 && 'Table'[response] = response1 ) ) RETURN IF ( ISFILTERED ( select111 ), CALCULATE ( COUNT ( 'Table'[response] ), FILTER ( 'Table', 'Table'[ID] IN ID1 ) ), COUNT ( 'Table'[response] ) )4.Then replace the counting measure for responses with the measure:
5.Here's my final result, which I hope meets your requirements.
Please find the attached pbix relevant to the case.Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The easiest solution is to unpivot your data. You should aim for a 3 column structure which is ID-Question-Answer.
I have done so, as written in the original post. I had a feeling the key to the answer might have been in there, and I guess I may need to work with lists and variables or something but I'm not sure how to go from there
- ray_aramburo2 years ago
Super User
Ah you're right. The image mislead me and thought you had a column per question. Have you tried using a hierarchy slicer (Question + Answer)? You could use some combination of that + restricting interactions with another table so you can see the whole picture in one table plus the user in another, and/or also edit the interactions to filter the detailed table based on a click(selection) of the user visual table.