Notifications
Clear all
Power Query
2
Posts
2
Users
0
Reactions
16
Views
Topic starter
Hello,
i have the source table:
Name
HotSummerInBerlin |
and now using query:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value")
in
#"Unpivoted Columns"
How can i keep column from source table?
The result should be:
Name|Attribute|Value
HotSummerInBerlin | Name | HotSummerInBerlin |
Best,
Jacek
Posted : 18/06/2021 5:54 am
Hi Jacek,
Add a custom column with this formula:
= Source
Expand the column to reveal the Name again.
Here is the code:
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"), #"Added Custom" = Table.AddColumn(#"Unpivoted Columns", "Custom", each Source), #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Name"}, {"Name"}) in #"Expanded Custom"
Mynda
Posted : 20/06/2021 12:35 am