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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
adrien1804
New Member

Parsing JSONs files from a folder

Hi Power BI Community,

 

I'm parsing JSON files from a folder and they could have different architectures on the second layer in the hierarchy for one of the four first items.

 

I succeeded to make it dynamic, that way when I change sample file it changed the output even column names are different from the the previous folder. However, if the files within this folder have different hierarchy it only display correctly the files similar to the sample file :

 

From my understanding, the problem is coming from this step :


#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File")))

 

Which is included in this :

#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),

 

To summarize and from my understandings, I need all column names from all JSON files that's way I could expand table column each one of the column listed in those JSON files.

 

If it's not clear enough, feel very free to ask any questions 🙂

 

Thank you very much in advance for your help 😀

 

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @adrien1804 ,
if this needs to be dynamic (at the cost of performance), then you could use the following syntax:

Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(Table.Combine(#"Removed Other Columns1"[Transform File]))),

 

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

View solution in original post

2 REPLIES 2
adrien1804
New Member

Hi @ImkeF ,
It works perfectly, thank you very much 🙏

ImkeF
Community Champion
Community Champion

Hi @adrien1804 ,
if this needs to be dynamic (at the cost of performance), then you could use the following syntax:

Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(Table.Combine(#"Removed Other Columns1"[Transform File]))),

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.