Forum Discussion

dw700d's avatar
dw700d
Icon for Post Patron rankPost Patron
7 years ago
Solved

Converting Yes & No Data to visuals

I have data that contains 45  different questions  and thousands of responses that include either "Yes", "No", "N/A". I would like to create a pie chart that shows the percentage of Yes Answers as a percentage of ALL responses including the N/A's? I would like to do this for each question.  Can someone help me with is? Below is an example of the data set .

 

StudentIs the Ball WhiteIs the Ball BlueIst the ball BrownIs the Ball redIs the ball pinkIs the Ball Yellow
1N/AYes

N/A

NoYesNo
2YesYesYesNoNoNo
54NOYesYesYesNoNo
4noYesYesYesNoNo
5N/AYesNoYesNoNo
43N/AYesYesYesNoYes
32noYesYesNoNoNo
9N/AYesYesYesNoNo
12noYesN/AYesNoYes
23YesYesYesYesNoNo
56YesYesYesYesNoNo
75YesYesYesYesNoYes
432YesYesYesYesNoYes
  • hi, dw700d

    You could try this way as below:

    In Edit Queries, select Student column,then right click->Upivot other columns

    or select all question columns ->Unpivot columns

    Close&Apply

    Then create a measure like this

    Measure = CALCULATE(COUNTA(Table1[Value]))/CALCULATE(COUNTA(Table1[Value]),ALLSELECTED(Table1))

    or

    Measure 2 = CALCULATE(COUNTA(Table1[Value]))/CALCULATE(COUNTA(Table1[Value]),ALLEXCEPT(Table1,Table1[Student]))

    Result:

     

    and here is pbix please try it.

     

    Best Regards,

    Lin

     

     

     

     

     

2 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, dw700d

    You could try this way as below:

    In Edit Queries, select Student column,then right click->Upivot other columns

    or select all question columns ->Unpivot columns

    Close&Apply

    Then create a measure like this

    Measure = CALCULATE(COUNTA(Table1[Value]))/CALCULATE(COUNTA(Table1[Value]),ALLSELECTED(Table1))

    or

    Measure 2 = CALCULATE(COUNTA(Table1[Value]))/CALCULATE(COUNTA(Table1[Value]),ALLEXCEPT(Table1,Table1[Student]))

    Result:

     

    and here is pbix please try it.

     

    Best Regards,

    Lin

     

     

     

     

     

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi dw700d

     

    I think it would be considerably easier if you start by unpivoting the table