Forum Discussion
Dennis154
8 years agoNew Member
Power-Query - Foreach or any other
Hi, this is a produced Example to show the problem. i have a Table named: Car_each_Country like this: Car Deutschland Frankreich Russland VW x ...
- 8 years ago
I think that you may be overcomplicating this one. You should just need your first table:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCgtX0lGqgONYnWilgPyi4oxUJGGwqE9iSiKIDUYQhUGpeYmlOSUwIZDCWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Car = _t, Deutschland = _t, Frankreich = _t, Russland = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Car", type text}, {"Deutschland", type text}, {"Frankreich", type text}, {"Russland", type text}}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Car"}, "Attribute", "Value"), #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] = "x")), #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Value"}), #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Attribute", "Country"}}) in #"Renamed Columns"
Greg_Deckler
8 years agoCommunity Champion
I think that you may be overcomplicating this one. You should just need your first table:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCgtX0lGqgONYnWilgPyi4oxUJGGwqE9iSiKIDUYQhUGpeYmlOSUwIZDCWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Car = _t, Deutschland = _t, Frankreich = _t, Russland = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Car", type text}, {"Deutschland", type text}, {"Frankreich", type text}, {"Russland", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Car"}, "Attribute", "Value"),
#"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] = "x")),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Value"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Attribute", "Country"}})
in
#"Renamed Columns"Dennis154
8 years agoNew Member
Hi,
you're so wonderfull, i love your answer.
many many thanks for answering..