Forum Discussion
Json columns not appearing
- 7 months ago
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. - 6 months ago
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.
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/json
How 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.