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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bchager6
Super User
Super User

Expand all .json records on import

Hello all...

 

I am importing a data set in a .json format and would like to know if anyone can guide me on expanding all child records (or records in particular parent columns) on import, assuming this is possible. The child records look to have the same column names as the original file I'm importing.

 

I've read around the board a bit but couldn't find a definitive solution. Are there updates I need to make in the Power Query Advanced Editor?

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @bchager6 ,

 

You can refer to the case , as cwebb' suggestion:

 

If you want all the data from the JSON file in a single table in a single query, you can click the "Expand" icon (which looks like two arrows, one pointing left, one pointing right) in the column header. You can also write some M code to automatically expand all the expandable columns in a table, similar to what I wrote about here: https://blog.crossjoin.co.uk/2014/05/21/expanding-all-columns-in-a-table-in-power-query/

 

Or could you please show us what the .json records and your desired output look like for further analysis?

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Chris' data looks different than the data I'm dealing with. Where Chris is presented with expandible columns, I am presented with columns that contain records with URLs behind them that lead to more rows and columns that describe the entity; department in the example below.

 

Capture.JPG

 

Hi Amy,

 

Thanks for your response. Here is a portion of my code. The three values below in red font are also column headers I see in Power Query containing rows with "Record" that are links to lower level values that may or may not be useful. 


<?xml version="1.0" encoding="ISO-8859-1"?>

<response><result><parent/><shadow>false</shadow><forecast_cost>0</ forecast_cost><watch_list/><phase_type>waterfall</phase_type><wbs/><upon_reject>cancel</upon_reject><sys_updated_on>2019-10-18 16:16:53</sys_updated_on><forecast_cost>0</forecast_cost><discount_rate>0</discount_rate><time_card>project_task</time_card><approval_history/><rollup>false</rollup><skills/><number>0001004</number><score>4.67</score><program/><start_date>2019-09-25 13:00:00</start_date><u_all_cis>false</u_all_cis><forecast>0</forecast><cost>5</cost><estimate>0</estimate><state>3</state><sys_created_by>san</sys_created_by><goals/><knowledge>false</knowledge><order/><phase>closing</phase><duration/><goal/><budget>0</budget><cmdb_ci/><dependency/><contract/><impact>1</impact><milestone>false</milestone><effort/><active>false</active><work_notes_list/><priority>4</priority><sys_domain_path>/</sys_domain_path><business_unit/><demand><link>https://xxxx.service-now.com/api/now/table/demand/be</link><value> be1a </value></demand

 

For example, when I click on the first "Record" in the Program column, the value I see looks something like this: 


Capture.JPG

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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