Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi
i ave this Json dataset and I want to transform it into a table with columns indicated in the json: Prodcut_ID and PRICE
the values are int rows records:
{
"columns": [
{
"name": "PRODUCT_ID",
"type": "text"
},
{
"name": "PRICE",
"type": "float"
}
],
"rows": [
[
"A26",
0.30447
],
[
"A158",
1.0970999
],
[
"A18898",
0.205
],
[
"A25177",
19.4
],
[
"A265",
130.95
]
]
}
My target output:
PRODUCT_ID | PRICE
---------------+---------------
A26 |0.30447
A158 |1.0970999
A18898 |0.205
A25177 |19.4
Thanks in advance
Solved! Go to Solution.
Hello @Anonymous ,
first you parse the JSON and then extract the values as follows:
let
Query1 = "{#(cr)#(lf) ""columns"": [#(cr)#(lf) {#(cr)#(lf) ""name"": ""PRODUCT_ID"",#(cr)#(lf) ""type"": ""text""#(cr)#(lf) },#(cr)#(lf) {#(cr)#(lf) ""name"": ""PRICE"",#(cr)#(lf) ""type"": ""float""#(cr)#(lf) }#(cr)#(lf) ],#(cr)#(lf) ""rows"": [#(cr)#(lf) [#(cr)#(lf) ""A26"",#(cr)#(lf) 0.30447#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A158"",#(cr)#(lf) 1.0970999#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A18898"",#(cr)#(lf) 0.205#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A25177"",#(cr)#(lf) 19.4#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A265"",#(cr)#(lf) 130.95#(cr)#(lf) ]#(cr)#(lf) ]#(cr)#(lf)}",
#"Parsed JSON" = Json.Document(Query1),
Custom1 = Table.FromRows(#"Parsed JSON"[rows], List.Transform(#"Parsed JSON"[columns], each _[name]))
in
Custom1
If you copy this code into the advanced editor you will see that the first step contains your JSON (with some line break code) and then the relevant steps follow.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hello @Anonymous ,
first you parse the JSON and then extract the values as follows:
let
Query1 = "{#(cr)#(lf) ""columns"": [#(cr)#(lf) {#(cr)#(lf) ""name"": ""PRODUCT_ID"",#(cr)#(lf) ""type"": ""text""#(cr)#(lf) },#(cr)#(lf) {#(cr)#(lf) ""name"": ""PRICE"",#(cr)#(lf) ""type"": ""float""#(cr)#(lf) }#(cr)#(lf) ],#(cr)#(lf) ""rows"": [#(cr)#(lf) [#(cr)#(lf) ""A26"",#(cr)#(lf) 0.30447#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A158"",#(cr)#(lf) 1.0970999#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A18898"",#(cr)#(lf) 0.205#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A25177"",#(cr)#(lf) 19.4#(cr)#(lf) ],#(cr)#(lf) [#(cr)#(lf) ""A265"",#(cr)#(lf) 130.95#(cr)#(lf) ]#(cr)#(lf) ]#(cr)#(lf)}",
#"Parsed JSON" = Json.Document(Query1),
Custom1 = Table.FromRows(#"Parsed JSON"[rows], List.Transform(#"Parsed JSON"[columns], each _[name]))
in
Custom1
If you copy this code into the advanced editor you will see that the first step contains your JSON (with some line break code) and then the relevant steps follow.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 18 | |
| 13 | |
| 9 | |
| 8 | |
| 8 |