Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
13 | |
11 |