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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mterry
Helper V
Helper V

Merging rows and using row values as both column headers and row values

I have a table that has a column filled with questions, and another column with applicable respoonses to those questions. I'm hoping I can transform this table using Power Query so that each question is a column header and the value in that column is the response. A sample of the table as-is now and what I'd like for it to look like is posted below:

Table now:

CompanyQuestionResponse
AcmeQuestion 1Yes
AcmeQuestion 2No 
AcmeQuestion 350
AcmeQuestion 4Blue

 

My desired result:

CompanyQuestion 1Question 2Question 3Question 4
AcmeYesNo50Blue
1 ACCEPTED SOLUTION
ronrsnfld
Super User
Super User

Just Pivot with no aggregation

 

Table.Pivot(#"Previous Step", List.Distinct(#"Changed Type"[Question]), "Question", "Response")

 

View solution in original post

4 REPLIES 4
Akash_Varuna
Super User
Super User

Hi @mterry , Could you please try this 

  • Select "Company" as the grouping column, "Question" as the column to pivot, and "Response" as the values.
  • Go to the "Transform" tab and click "Pivot Column."
  • In the dialog, set "Values Column" to "Response" and "Column to Pivot" to "Question."
    If this post helped please do give a kudos and accept this as a solution
    Thanks In Advance

 

Thanks for the response - I didn't get a chance to try as the previous response worked. 

ronrsnfld
Super User
Super User

Just Pivot with no aggregation

 

Table.Pivot(#"Previous Step", List.Distinct(#"Changed Type"[Question]), "Question", "Response")

 

Thanks this worked!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors