This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi ,
I have a JSON string that i want to extract in power bi. It is the following JSON string:
{
"id": "...",
"name": "...",
"address": "...",
"types": [
"shopping_mall",
"point_of_interest",
"establishment"
],
"coordinates": {
"lat": ...,
"lng": ...
},
"rating": 3.7,
"rating_n": 1495,
"international_phone_number": "...",
"current_popularity": 35,
"populartimes": [
{
"name": "Monday",
"data": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
],
"time_spent": [
15,
60
]
}
The most important thing is the "populartimes": [...]. In this section I get the data of each day (times 7). And i want to extract this all in one column. I have come a whole end and got to this point (see picture 1)
What i want is the following thing, but than for eacht column.
I have fold out this first column. But when I try to do this for the second column I get a lot more columns than the 24 I want to. What steps do I have to follow? Or is there a manuel that explains how to extract JSON data?
Solved! Go to Solution.
Hi @Anonymous ,
I think I have it, try the steps in this file.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
HI @Anonymous,
I'm not so sure how your records stored, I copy your sample data and try to add more records, you can check below sample code if they suitable for your requirements.
Sample data:
{
"id":"...",
"name":"...",
"address":"...",
"types":[
"shopping_mall",
"point_of_interest",
"establishment"
],
"coordinates":{
"lat":"...",
"lng":"..."
},
"rating":3.7,
"rating_n":1495,
"international_phone_number":"...",
"current_popularity":35,
"populartimes":[
{
"name":"Monday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Tuesday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Wednesday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Thursday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Friday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Saturday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Sunday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
}
],
"time_spent":[
15,
60
]
}Power query formula:
let
Source = Json.Document(File.Contents("C:\Users\xxxxx\Desktop\sample.json"))[populartimes],
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"name", "data"}, {"name", "data"}),
#"Added Custom" = Table.AddColumn(#"Expanded Column1", "Merged", each Text.Combine(List.Transform([data],each Text.From(_)),",")),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"data"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Monday", type text}, {"Tuesday", type text}, {"Wednesday", type text}, {"Thursday", type text}, {"Friday", type text}, {"Saturday", type text}, {"Sunday", type text}})
in
#"Changed Type"
Regards,
Xiaoxin Sheng
Thank you both for your replys!
Both answers are correct and does what i wanted. The difference is that one is solved with code and the other with power bi extractions.
HI @Anonymous,
I'm not so sure how your records stored, I copy your sample data and try to add more records, you can check below sample code if they suitable for your requirements.
Sample data:
{
"id":"...",
"name":"...",
"address":"...",
"types":[
"shopping_mall",
"point_of_interest",
"establishment"
],
"coordinates":{
"lat":"...",
"lng":"..."
},
"rating":3.7,
"rating_n":1495,
"international_phone_number":"...",
"current_popularity":35,
"populartimes":[
{
"name":"Monday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Tuesday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Wednesday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Thursday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Friday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Saturday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
},
{
"name":"Sunday",
"data":[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
31,
32,
24,
14,
0,
0,
0,
0,
0,
0
]
}
],
"time_spent":[
15,
60
]
}Power query formula:
let
Source = Json.Document(File.Contents("C:\Users\xxxxx\Desktop\sample.json"))[populartimes],
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"name", "data"}, {"name", "data"}),
#"Added Custom" = Table.AddColumn(#"Expanded Column1", "Merged", each Text.Combine(List.Transform([data],each Text.From(_)),",")),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"data"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Monday", type text}, {"Tuesday", type text}, {"Wednesday", type text}, {"Thursday", type text}, {"Friday", type text}, {"Saturday", type text}, {"Sunday", type text}})
in
#"Changed Type"
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
I think I have it, try the steps in this file.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 31 | |
| 26 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 37 | |
| 33 | |
| 23 | |
| 23 |