Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
KNO
Helper I
Helper I

How to extract latitudes and longitude?

Hi, 

 

This is proberply a simple quest, but how would to extract coordinates that reside in the same column?

Udklip.PNG

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@KNO 

I created a sample:

Fowmy_0-1622977096643.png


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:

Fowmy_3-1622977232228.png

 



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@KNO 

I created a sample:

Fowmy_0-1622977096643.png


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:

Fowmy_3-1622977232228.png

 



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors