Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello.
I have rest-api result
{
"name": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
}
I am exec this query:
let
ApiCall = () =>
let
Source = Json.Document(Web.Contents("https://contoso.com/api")),
#"Converted to Table" = Record.ToTable(Source[name])
in
#"Converted to Table"
in
ApiCall
and get two-column table:
How-to convert this table to
?
Solved! Go to Solution.
Hi @dt
Try Adding
= Table.ExpandRecordColumn(#"Converted to Table", "Value", {"key1", "key2", "key3"}, {"key1", "key2", "key3"})
Hi @dt
Try this,
// output
let
Source = name,
#"Converted to Table" = Record.ToTable(Source),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Value", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Name]), "Name", "Value")
in
#"Pivoted Column"
Hi @dt
I've converted your sample JSON to a flat-file and used it as a base for my query, I've attached the result with JSON converted to records for the reference.
name = JSON translated to a record
output = transformed query
let me know if "name" is in wright structure.
Thank you!
But still getting the error.
Any ideas?
Hi @dt
Sorry for the late reply.
I've used the JSON sample from your original post and produced a solution in the attached file, please can you ensure that the sample is a true reflection of your scenario, if not, please can you adjust.
Unfortunately, your screenshot does not give enough information to understand the error.
Yes, this fully reflects my problem.
Your solution in the attached file not work.
My PowerBI Desktop Version: 2.73.5586.1241 64-bit (September 2019).
What information is needed?
Hi @dt
Please see the below.
Once converted your sample to a record it will look like below.
Step 1 - Source // no error as on the attached.
Step 2 - Convert to table // no error
Step 3 // Expanded Value
Please can you confirm in witch step do you start getting the error message?
As demonstrated above, all is working fine on my end.
I upgraded to Version: 2.73.5586.1501 64-bit (September 2019)
Now everything is all right, thanks!
Hi @Mariusz
Sorry, my query looks a little different:
I uploaded json record to table.pbix here: json record to table
Hi @dt
Try this,
// output
let
Source = name,
#"Converted to Table" = Record.ToTable(Source),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Value", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Name]), "Name", "Value")
in
#"Pivoted Column"
Hi @dt
Try Adding
= Table.ExpandRecordColumn(#"Converted to Table", "Value", {"key1", "key2", "key3"}, {"key1", "key2", "key3"})
Getting an error
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
89 | |
78 | |
57 | |
40 | |
39 |