Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi - I'm attempting to expand the data from a USDA report; https://mpr.datamart.ams.usda.gov/services/v1.1/reports/2498
I can get it into PowerQuery editor easily, but I cannot figure out how to expand the whole thing into the row level data. I get here:
Then convert it to a table, but then I'm stuck. Any next step gives me a list of values, rather than the dataset that I'm looking for.
I would really appreciate any help.
Thanks in advance~
Here's one way to do it in the query editor. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let
Source = Json.Document(Web.Contents("https://mpr.datamart.ams.usda.gov/services/v1.1/reports/2498")),
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded stats" = Table.ExpandRecordColumn(#"Converted to Table", "stats", {"totalRows:", "returnedRows:", "userAllowedRows:"}, {"stats.totalRows:", "stats.returnedRows:", "stats.userAllowedRows:"}),
#"Expanded results" = Table.ExpandListColumn(#"Expanded stats", "results"),
#"Expanded results1" = Table.ExpandRecordColumn(#"Expanded results", "results", {"report_date", "is_correction", "narrative", "report_title", "slug_name", "slug_id", "office_name", "office_code", "office_city", "office_state", "market_location_name", "market_location_city", "market_location_state", "market_type", "market_type_category", "published_date"}, {"report_date", "is_correction", "narrative", "report_title", "slug_name", "slug_id", "office_name", "office_code", "office_city", "office_state", "market_location_name", "market_location_city", "market_location_state", "market_type", "market_type_category", "published_date"})
in
#"Expanded results1"
Pat
Thanks - but it still doesn't appear that the query is fully expanded:
Thanks for the help!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |