// One row per respondent // Pack: Survey responses (Power Query Exercises, https://powerqueryexercises.com/downloads/survey-responses-pivot) // // Source bindings // In the Power Query Exercises simulator each name below is bound directly to a pack file. In Excel or // Power BI Desktop the first steps of this query do that binding instead: // Responses the pack file responses.csv -> File.Contents(PackFolder & "responses.csv") // Set PackFolder to the folder where you extracted the pack (keep the trailing backslash). // // Validated in the Power Query Exercises simulator (engine 0.1.0) against this pack's files; it returns // 7 rows with columns RespondentID, Q1 Ease, Q2 Speed, Q3 Support, Q4 Recommend. // It has not been run in Excel or Power BI by us. This is query text, not a ready-to-refresh workbook. // Independent practice material; not affiliated with or endorsed by Microsoft. let PackFolder = "C:\PQE\survey-responses-pivot\", Responses = File.Contents(PackFolder & "responses.csv"), Source = Table.TransformColumnTypes(Table.PromoteHeaders(Csv.Document(Responses, [Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.Csv])), {{"Score", Int64.Type}}), #"Questions" = List.Sort(List.Distinct(Source[Question])), #"Pivoted" = Table.Pivot(Source, #"Questions", "Question", "Score", List.Max) in #"Pivoted"