Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
This is proberply a simple quest, but how would to extract coordinates that reside in the same column?
Solved! Go to Solution.
@KNO
I created a sample:
You can paste the code given below on a new blank query in the advanced editor and check the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bdC7CoAwDIXhd+lcQm+J7Vu4i7OL6OzbmyEROboVfr4eyLKE+dyv7TxCDIMy18KizxTW+E4s1IWl/qRBJZnKqCYSU5hU+VZB1amZwjSo+lZFpT+awqTKtxokSZRMYRrUfIu/yq+BSZVvCar8XEPTegM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [geometry.type = _t, geometry.coordinates = _t, Indeks = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"geometry.type", type text}, {"geometry.coordinates", type number}, {"Indeks", Int64.Type}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Inserted Modulo" = Table.AddColumn(#"Added Index", "Modulo", each Number.Mod([Index], 2), type number),
#"Removed Columns" = Table.RemoveColumns(#"Inserted Modulo",{"Index"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Removed Columns", {{"Modulo", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Removed Columns", {{"Modulo", type text}}, "en-US")[Modulo]), "Modulo", "geometry.coordinates"),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"1", "Lat"}, {"0", "Log"}})
in
#"Renamed Columns"
Result:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@KNO
I created a sample:
You can paste the code given below on a new blank query in the advanced editor and check the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bdC7CoAwDIXhd+lcQm+J7Vu4i7OL6OzbmyEROboVfr4eyLKE+dyv7TxCDIMy18KizxTW+E4s1IWl/qRBJZnKqCYSU5hU+VZB1amZwjSo+lZFpT+awqTKtxokSZRMYRrUfIu/yq+BSZVvCar8XEPTegM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [geometry.type = _t, geometry.coordinates = _t, Indeks = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"geometry.type", type text}, {"geometry.coordinates", type number}, {"Indeks", Int64.Type}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Inserted Modulo" = Table.AddColumn(#"Added Index", "Modulo", each Number.Mod([Index], 2), type number),
#"Removed Columns" = Table.RemoveColumns(#"Inserted Modulo",{"Index"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Removed Columns", {{"Modulo", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Removed Columns", {{"Modulo", type text}}, "en-US")[Modulo]), "Modulo", "geometry.coordinates"),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"1", "Lat"}, {"0", "Log"}})
in
#"Renamed Columns"
Result:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group