Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Survey analysis: selection/filtering respondents based on responses

I have a simple dataset in PowerBI from a survey. 80 respondents filled out a 13 question survey with a Likert-scale answer model (strongly disagree to strongly agree). Data is presented in a 14 colu...
  • Anonymous's avatar
    Anonymous
    2 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.