Skip to content

Instantly share code, notes, and snippets.

@stephlocke
Created November 9, 2020 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephlocke/a8f189dbcf152dd11404eec7690cbb94 to your computer and use it in GitHub Desktop.
Save stephlocke/a8f189dbcf152dd11404eec7690cbb94 to your computer and use it in GitHub Desktop.
Get and transform NomCom table in Power Query
let
Source = Web.Page(Web.Contents("https://www.pass.org/Governance/Elections")),
Data5 = Source{5}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data5,{{"", type text}, {"Joey D'Antoni", type number}, {"Lori Edwards", type number}, {"Roberto Fonseca", type number}, {"Matt Gordon", type number}, {"Stephanie Locke", type number}, {"Jose L. Rivera", type number}, {"Hamish Watson", type number}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"", "Area"}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Area"}, "Attribute", "Value"),
#"Renamed Columns1" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Candidate"}})
in
#"Renamed Columns1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment