Forum Discussion

haniizz's avatar
haniizz
Helper II
3 years ago
Solved

converting multiple columns to rows

hello guys , I have this table as a dataset for a survey collected from 11 respondents

 

respondentbest color / redbest color / orangebest color / yellowbest color / green

1

0010
21000
31000
41000
50100
61011
70110
80001
90010
100100
110100

 

how can load this data that will allow me to analyse it like the table below

 

best colorresponses
red4
orange4
yellow4
green2

 

 

and allow me to visualise it like this chart

 

 

I hope I simplified my  question

  • Hi haniizz ,

    After loading your data, click Transform Data to open the Power Query Editor.

    Then CTRL+Click to select all of the color columns and click Unpivot Columns.

    Click Close & Apply to close the Power Query Editor.

     

    The next step is not strictly necessary, but click "New Measure" and create a measure like below (adjust for your table and column names)

    SumValue = SUM(Colors[Value])
     
    Then add a clustered column chart like below
     
    The chart will look something like this:
     
    Please accept as solution if you think this has answered the question.

2 Replies

  • Hi haniizz ,

    After loading your data, click Transform Data to open the Power Query Editor.

    Then CTRL+Click to select all of the color columns and click Unpivot Columns.

    Click Close & Apply to close the Power Query Editor.

     

    The next step is not strictly necessary, but click "New Measure" and create a measure like below (adjust for your table and column names)

    SumValue = SUM(Colors[Value])
     
    Then add a clustered column chart like below
     
    The chart will look something like this:
     
    Please accept as solution if you think this has answered the question.
    • haniizz's avatar
      haniizz
      Helper II

      thank you dj for you prompt response, that's helpful