power bi expand json array column to new table

Опубликовано: 04 Август 2026
на канале: CodeNode
30
0

Download 1M+ code from https://codegive.com/143b4ab
certainly! in power bi, you can expand a json array column into a new table using power query. this allows you to transform nested json data into a more tabular format, which is easier to analyze and visualize. below is a step-by-step tutorial to help you through the process, along with code examples.

tutorial: expanding a json array column in power bi

step 1: load data into power bi

1. *open power bi desktop.*
2. *get data:* click on “home” in the ribbon, then click on “get data” and choose your data source. this could be a json file, a web api, or any other supported data source.
3. *load data:* follow the prompts to load your json data into power bi.

step 2: open power query editor

1. after loading the data, click on “transform data” in the home tab to open the power query editor.

step 3: identify the json array column

1. locate the column that contains the json array. it will typically be a column where each cell contains a json-formatted string or a record.

step 4: expand the json array

1. select the column containing the json array.
2. in the column header, you will see a small icon that looks like two arrows pointing away from each other (this is the "expand" button). click on this icon.
3. if your json contains nested records or arrays, power query will prompt you to select which fields you want to expand. select the fields you need and click ok.

step 5: transforming the data

at this point, you may have a new table, but you might want to apply additional transformations, such as renaming columns, changing data types, or filtering rows.

example of m code

if you prefer to write or view the m code directly, here’s an example of what the m code might look like when expanding a json array:



explanation of the code:

*source:* loads the json file.
*datatable:* converts the json document into a table format.
*expandcolumn:* expands the array column named "data".
*expandedtable:* converts the expanded list into a table.
...

#PowerBI #JSON #windows
Power BI
expand JSON array
column transformation
new table
data modeling
Power Query
JSON parsing
data visualization
data analysis
table creation
data extraction
ETL process
data manipulation
DAX functions
report building