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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
akoconnor
New Member

newbie transformation question

Hello!  New to PQ and I may not have the proper vocabulary to ask this, possibly, simple question.

 

I have been given data that is iteritive in rows. I know I need to transform it but everything I try is not quite right. In the data below, for each question I would like to have a seperate column, but only one row for Sofia and her answers in the correct column. Thoughts?

 

What I have:

NameQuestionAnswer
SofiaInstitution: - (MQ0194)UAB
SofiaDepartment/Division: - (MQ0195)Neurobiology
SofiaRegistrant type: - (MQ0196)Faculty: Instructor, Assistant Professor, Associate Professor, or Professor
SofiaPlease select your mentor from this list of Cancer Center Members: - (MQ0197)Sofia  NO
SofiaWill you be presenting a poster at this year's retreat? - (MQ0198)No
SatoruInstitution: - (MQ0194)UAB
SatoruDepartment/Division: - (MQ0195)Neurosurgery
SatoruRegistrant type: - (MQ0196)Faculty: Instructor, Assistant Professor, Associate Professor, or Professor
SatoruPlease select your mentor from this list of Cancer Center Members: - (MQ0197)Erwin  NO
SatoruWill you be presenting a poster at this year's retreat? - (MQ0198)No

 

What I want:

NameInstitution: - (MQ0194)Department/Division: - (MQ0195)Registrant type: - (MQ0196)Please select your mentor from this list of Cancer Center Members: - (MQ0197)Will you be presenting a poster at this year's retreat? - (MQ0198)
SofiaUABNeurobiologyFaculty: Instructor, Assistant Professor, Associate Professor, or ProfessorSofia  NO

No

 

SatoruUABNeurosurgeryFaculty: Instructor, Assistant Professor, Associate Professor, or ProfessorErwin NONo

 

1 REPLY 1
ronrsnfld
Super User
Super User

This is a simple Pivot on the Question column with No Aggregation

From the UI:

ronrsnfld_0-1689202039220.png

 

Code from Advanced Editor

 

let

//Change next line to reflect actual data source
    Source = Excel.CurrentWorkbook(){[Name="Table21"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"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"

 

ronrsnfld_1-1689202283471.png

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors