Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Data shaping and columns

Hi   I have the below dataset   Column O is a question from a survey that asks customers what word(s) best describe the service they received from us. As there are multiple choices to pick ...
  • v-yuta-msft's avatar
    v-yuta-msft
    6 years ago

    Anonymous ,

     

    Click query editor-> Transform-> click on the columns then click "Unpivot columns". You will achieve two columns [Attribute] and [Value]. Then create a measure using dax like pattern below:

    Helpful_Count =
    CALCULATE (
        COUNT ( Table[Value] ),
        ALLEXCEPT ( Table, Table[Start Date], Table[Attribute] )
    )
    

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    6 years ago

    Thanks v-yuta-msft 

     

    I had to add a little bit in so my measure ended up looking like this:

     

    Helpful_Count = CALCULATE(
    COUNT(Table[Value]),
    ALLEXCEPT(Table,Table[Start Date],Table[Attribute]),
    FILTER(Table,Table[Value]="Helpful")
    )
     
    and then repeated this, changing "Helpful" for the other options that could've been selected.