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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to make new columns from values from another column?

Sorry if this has been asked before. I've searched but maybe my wording on my searches isn't finding what I'm trying to accomplish.

 

I have a set of data and I've created an example to go by and attached it here.

 

One column has multiple values. I need to take those values from the Question column and turn those values into it's own column and take the Yes, No, and N/A answers to those questions and align them into a new column but coincide with the question they goto.

 

How can I achieve this in the power query? 

 

This is the data:

Kailef_0-1716236258354.png

 

This is how I need it to look in the query before having it loaded onto my report:

Kailef_1-1716236303030.png

 

1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi @Anonymous,

I'm attaching a excel file with my solution.
My M code is this:

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




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

1 REPLY 1
_AAndrade
Super User
Super User

Hi @Anonymous,

I'm attaching a excel file with my solution.
My M code is this:

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




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.