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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Multipoint GeoJson data to map

Hi,

 

I'm new to Power Bi and I would like to achieve a map with multipoints from a geoJson data.

 

Here is an example geoJson data with 2 points (coordinates)

 

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "MultiPoint",
"coordinates": [
[
4.446657,
51.02457
],
[
4.479846,
50.944796
]
]
},
"properties": {
"prop0": "value0"
}
}
]
}

And here is an example what I would like to achieve.

2020-07-31_10-19-34.png

 

I couldn't find much information on web how I can use Power Bi with geoJson data. Is that possible to achieve multipoint map with Power Bi? How can i do that? Thanx

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Step 1. Save your geojson in Json format : GeoJson.Json

Step 2. Paste below advanced query in the advanced editor in transform data :
 let
Source = Json.Document(File.Contents("C:\Users\Desktop\geojson.json")),
features = Source[features],
features1 = features{0},
#"Converted to Table" = Record.ToTable(features1),
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"type", type text}, {"geometry", type any}, {"properties", type any}}),
#"Expanded geometry" = Table.ExpandRecordColumn(#"Changed Type", "geometry", {"type", "coordinates"}, {"type.1", "coordinates"}),
#"Expanded properties" = Table.ExpandRecordColumn(#"Expanded geometry", "properties", {"prop0"}, {"prop0"}),
#"Expanded coordinates" = Table.ExpandListColumn(#"Expanded properties", "coordinates"),
#"Extracted Values" = Table.TransformColumns(#"Expanded coordinates", {"coordinates", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "coordinates", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"coordinates.1", "coordinates.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"coordinates.1", type number}, {"coordinates.2", type number}})
in
#"Changed Type1"

Step 3: Close and Apply 

step 4: Change the data type of cordinates.1 and cordinates.2 by selecting the columns to logitude and latitude respectively.
step 5 : pull the logitude and latitude in map visual.Final.PNGTransformdata-->Getdata-->Newquery-->advancededitor--> cody the code and paste--> applyTransformdata-->Getdata-->Newquery-->advancededitor--> cody the code and paste--> apply

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Step 1. Save your geojson in Json format : GeoJson.Json

Step 2. Paste below advanced query in the advanced editor in transform data :
 let
Source = Json.Document(File.Contents("C:\Users\Desktop\geojson.json")),
features = Source[features],
features1 = features{0},
#"Converted to Table" = Record.ToTable(features1),
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"type", type text}, {"geometry", type any}, {"properties", type any}}),
#"Expanded geometry" = Table.ExpandRecordColumn(#"Changed Type", "geometry", {"type", "coordinates"}, {"type.1", "coordinates"}),
#"Expanded properties" = Table.ExpandRecordColumn(#"Expanded geometry", "properties", {"prop0"}, {"prop0"}),
#"Expanded coordinates" = Table.ExpandListColumn(#"Expanded properties", "coordinates"),
#"Extracted Values" = Table.TransformColumns(#"Expanded coordinates", {"coordinates", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "coordinates", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"coordinates.1", "coordinates.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"coordinates.1", type number}, {"coordinates.2", type number}})
in
#"Changed Type1"

Step 3: Close and Apply 

step 4: Change the data type of cordinates.1 and cordinates.2 by selecting the columns to logitude and latitude respectively.
step 5 : pull the logitude and latitude in map visual.Final.PNGTransformdata-->Getdata-->Newquery-->advancededitor--> cody the code and paste--> applyTransformdata-->Getdata-->Newquery-->advancededitor--> cody the code and paste--> apply

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors