Forum Discussion
SloeMo
3 years agoFrequent Visitor
Unpivotting multiple columns - Power query
Hi all, I have a sharepoint list with multiple columns in that I am tryting to pivot into a usable format. So far I have tried lots of steps which have all failed with the result of me creating duplc...
- 3 years ago
Hi
Unpivot columns, Split Attribute, Pivot
let
Source = YourSource,
Unpivot = Table.UnpivotOtherColumns(Source, {"Programme ", "Business Case Name", "Business Case Owner"}, "Attribute", "Value"),
#"Split Column" = Table.SplitColumn(Unpivot, "Attribute", Splitter.SplitTextByCharacterTransition({"0".."9"}, {" "}), {"Attribute.1", "Attribute.2"}),
Trim = Table.TransformColumns(#"Split Column",{{"Attribute.2", Text.Trim, type text}}),
Pivot = Table.Pivot(Trim, List.Distinct(Trim[Attribute.2]), "Attribute.2", "Value")
in
PivotStéphane
HoussemDhahri
3 years agoNew Member
Hello ,
I have a scenario maybe it can help you :
- Duplicate your table.
- Remove all features related to Area 2 from the first table. Instead, add a new column called 'Area' and fill it with the value 'Area1' for all rows.
- Remove all features related to Area 1 from the second table. Instead, add a new column called 'Area' and fill it with the value 'Area2' for all rows.
- Append both tables together and rename the headers as desired.