Forum Discussion
Anonymous
4 years agoNot applicable
Dynamic unpivot of columns in Power Query
Hi, I am using the function = Table.Unpivot(#"Filtered Rows1", {"x","y","z"...}, "Attribute", "Value") to unpivot a table by those selected rows. However, they are input values and will change a...
- 4 years ago
Something like:
= Table.Unpivot(#"Filtered Rows1", List.RemoveFirstN(Table.ColumnNames(#"Filtered Rows1"),3), "Attribute", "Value")
BA_Pete
4 years agoSuper User
Hi Anonymous ,
Flip the operation on its head: Select all the columns you DON'T want to unpivot, then go to Transform tab > Unpivot Columns (dropdown) > Unpivot OTHER columns.
This will generate code like this instead:
Table.UnpivotOtherColumns(previousStep, {"fixedColumnA", "fixdColumnB"}, "Attribute", "Value")
Pete