Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Transform rows from certain columns to colunms

Hello all,

 

I have a very simple question. I have a very long table with many repatitive question. Here is an example:

Capture.PNG

 

I would like to tranform this table so as every question be under a unique column as follows:

Capture.PNG

 

Can please someone advice or send a similar case?

 

The values of the answers are both integer and text.

 

Please let me know.

 

Thank you,
Stavros

2 REPLIES 2
danextian
Super User
Super User

Hi @Anonymous,

 

In Power Query, do the following:

 

  • Click Question column. The values in this column be used as the names of the columns to be created.
  • Go to Transform tab then click Pivot Column. A dialogue box will appear.
  • Select Answer from the Values Column dropdown.
  • Click the arrow just before Advanced Option.
  • Clcik Don't Aggregate from the dropdown.
  • Then click OK.




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Floriankx
Solution Sage
Solution Sage

Hello,

 

In Power Query it is

let
    Source = Excel.CurrentWorkbook(){[Name="Questions"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Reference", Int64.Type}, {"Question", type text}, {"Answer", type text}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Question]), "Question", "Answer")
in
    #"Pivoted Column"

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.