Forum Discussion
Json columns not appearing
Hello,
I'm adding some new data to an Import query in PowerBI. The data is in JSON format,
In PowerQuery Editor, I've right-click on the column we want to parse JSON, and selected "Transform" and "JSON"
I've "expanded" the button that appeared on the top right corner of column header.
This has only loaded a list of 27 columns (there should be many more)
Clicking on "Load more" doesn't add any extra columns. There is a message that reads "limit of 1000 scanned rows reached" but I'm not sure how to change this or how to get the missing columns of data added.
Hope someone can help,
Kind regards,
John
Please try adjusting your code
let Source = ... , // Your original data source steps // ... other steps ... PreviousStep = ... //Find the line for the pre-expansion step (e.g., Parsed JSON = ...) and Add the following lines right after it to collect all unique field names and then expand. Parsed JSON = Table.TransformColumns(PreviousStep, {{"Data", Json.Document, type any}}), // Example of your JSON parse step AllFields = List.Sort(List.Distinct(List.Combine(List.Transform(Parsed JSON[Data], Record.FieldNames)))), Expanded = Table.ExpandRecordColumn(Parsed JSON, "Data", AllFields, AllFields) in ExpandedI hope this helps.
If this response was helpful in any way, I’d gladly accept a kudo and Please mark it as the correct solution.
It helps other community members find their way faster.Hello JRowe,
This is expected behavior in Power Query and is caused by how it detects schema for JSON data.
When you expand a JSON column in Power Query, the engine only scans a sample of rows (usually the first 1000) to infer which fields exist. The list of columns you see in the expand menu is built only from what Power Query finds in those rows. If some JSON fields only appear after row 1000, they will not be detected and therefore won’t show up.
So the data isn’t missing — Power Query just hasn’t discovered those fields yet.
This is documented behavior. The official Power Query JSON connector documentation explains that Power Query uses automatic table detection and schema inference when flattening JSON, based on the data it previews, not necessarily the full dataset:
https://learn.microsoft.com/en-us/power-query/connectors/jsonHow to fix it
Option 1 – Force schema from a complete row (best if possible)
If you know a row that contains all possible JSON fields:Filter the table to that row.
Expand the JSON column.
Remove the filter.
This forces Power Query to build the schema from a complete record.
Option 2 – Expand using explicit M code (most reliable)
Instead of using the expand button, define the columns manually:= Table.ExpandRecordColumn( Source, "OutboundJson", {"field1", "field2", "field3", "field4"}, {"field1", "field2", "field3", "field4"} )This forces Power Query to create those columns even if they appear after the first 1000 rows.
Option 3 – Inspect all available keys first
You can discover all possible fields across rows with:= Record.FieldNames([OutboundJson])This helps you see what exists before expanding.
Important note
The “Column profiling based on entire dataset” option only affects profiling and statistics. It does not reliably override the JSON schema detection limit.
Key takeaway
Auto-expanding JSON in Power Query is based on sampling, not the full dataset. For production models, you should always control the schema manually.
3 Replies
- pcoleySuper User
Please try adjusting your code
let Source = ... , // Your original data source steps // ... other steps ... PreviousStep = ... //Find the line for the pre-expansion step (e.g., Parsed JSON = ...) and Add the following lines right after it to collect all unique field names and then expand. Parsed JSON = Table.TransformColumns(PreviousStep, {{"Data", Json.Document, type any}}), // Example of your JSON parse step AllFields = List.Sort(List.Distinct(List.Combine(List.Transform(Parsed JSON[Data], Record.FieldNames)))), Expanded = Table.ExpandRecordColumn(Parsed JSON, "Data", AllFields, AllFields) in ExpandedI hope this helps.
If this response was helpful in any way, I’d gladly accept a kudo and Please mark it as the correct solution.
It helps other community members find their way faster. - Olufemi7Super User
Hello JRowe,
This is expected behavior in Power Query and is caused by how it detects schema for JSON data.
When you expand a JSON column in Power Query, the engine only scans a sample of rows (usually the first 1000) to infer which fields exist. The list of columns you see in the expand menu is built only from what Power Query finds in those rows. If some JSON fields only appear after row 1000, they will not be detected and therefore won’t show up.
So the data isn’t missing — Power Query just hasn’t discovered those fields yet.
This is documented behavior. The official Power Query JSON connector documentation explains that Power Query uses automatic table detection and schema inference when flattening JSON, based on the data it previews, not necessarily the full dataset:
https://learn.microsoft.com/en-us/power-query/connectors/jsonHow to fix it
Option 1 – Force schema from a complete row (best if possible)
If you know a row that contains all possible JSON fields:Filter the table to that row.
Expand the JSON column.
Remove the filter.
This forces Power Query to build the schema from a complete record.
Option 2 – Expand using explicit M code (most reliable)
Instead of using the expand button, define the columns manually:= Table.ExpandRecordColumn( Source, "OutboundJson", {"field1", "field2", "field3", "field4"}, {"field1", "field2", "field3", "field4"} )This forces Power Query to create those columns even if they appear after the first 1000 rows.
Option 3 – Inspect all available keys first
You can discover all possible fields across rows with:= Record.FieldNames([OutboundJson])This helps you see what exists before expanding.
Important note
The “Column profiling based on entire dataset” option only affects profiling and statistics. It does not reliably override the JSON schema detection limit.
Key takeaway
Auto-expanding JSON in Power Query is based on sampling, not the full dataset. For production models, you should always control the schema manually.