Skip to main content
100%

JSON to Table in Power Query M

✓ Published0🌍 Public
HHugoberry
Last edited Mar 2, 2017
Created on Feb 23, 2017

This example demonstrates a Power Query M function that converts arbitrary JSON data into a structured table. It shows the step-by-step process of detecting expandable record and list columns, then iteratively expanding them until all nested objects are flattened. The code uses core M APIs such as `Table.ExpandRecordColumn`, `Table.ExpandListColumn`, `List.Accumulate`, and `List.Generate` to handle consistent and inconsistent column types. The source is a JSON object or list, which is transformed into a final normalized table through a loop that checks column types and applies the appropriate expansion method.

AI-generated description

Similar vizzes