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
val21bergman
Employee
Employee

Append an id column with the Table.FromList command

I am importing JSON data to PBI.  I am using developer.marvel.com API calls to get character, comic, series, story, and event data.  I have successfully extracted List fields to tables and split the columns from my JSON files to get my tables.  However, my character JSON file holds collections of all relationships between character and the other objects.  I was trying to, through query editor, create new relationship tables to include the character id and the comic id as one relationship table, character id and series id as another relationship table, etc.

 

I know I can use the Table.FromList syntax in Power Query to extract a new table with all of the list details for each column already in the character table, which would work if I could also somehow add a column to preserve from which character id the related list was extracted.   However, I cannot figure out the syntax to both create the table from the list and define an additional calculated column as the characterid.  Thoughts?  

 

Annotation 2020-01-07 133350.png

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi @val21bergman 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

And I think you could put them into two steps to get it.

 

Regards,

Lin

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

I am unsure what else you would like to see beyond the screen shots above.  The data itself is immaterial - just trying to extract the id field (shown in the screen shot I attached in the thread) and append to the Table.FromList results.  

val21bergman
Employee
Employee

I had initially had this screen shot inserted after the first paragraph to illustrate the character table, but it got dropped.  Adding it here.

 

Annotation 2020-01-07 133351.png

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.