Forum Discussion
tilldunk
8 years agoFrequent Visitor
Converting JSON data into PowerBI table
Hello, I got some data from IOT table storage including a column with JSON data, as below. I want to extract the data of the fourth column and started with expanding the content and ...
- 8 years ago
Hi tilldunk,
I try to test bu getting date from a json file. I import the data and right click the record column->To table as follows.
Then click expanded columns, get the list column, then click "Expand to New Rows"-> expanded column, I get expected result.
Here is my Query statement.let Source = Json.Document(File.Contents("C:\Users\v-huizhn\Downloads\generated.json")), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"UserId", "id", "tipSecurableSet"}, {"Column1.UserId", "Column1.id", "Column1.tipSecurableSet"}), #"Expanded Column1.tipSecurableSet" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1.tipSecurableSet", {"id", "Clients"}, {"Column1.tipSecurableSet.id", "Column1.tipSecurableSet.Clients"}), #"Expanded Column1.tipSecurableSet.Clients" = Table.ExpandListColumn(#"Expanded Column1.tipSecurableSet", "Column1.tipSecurableSet.Clients"), #"Expanded Column1.tipSecurableSet.Clients1" = Table.ExpandRecordColumn(#"Expanded Column1.tipSecurableSet.Clients", "Column1.tipSecurableSet.Clients", {"@odata.type", "typeId", "Entityids", "Clientid"}, {"[email protected]", "Column1.tipSecurableSet.Clients.typeId", "Column1.tipSecurableSet.Clients.Entityids", "Column1.tipSecurableSet.Clients.Clientid"}) in #"Expanded Column1.tipSecurableSet.Clients1"
For your scenario, I can't reproduce it. Do you mind share the sample table for further analysis?
Best Regards,
Angelia
tilldunk
8 years agoFrequent Visitor
Yes, I did. It will give me this table:
ImkeF
8 years agoCommunity Champion
Oh, I see: Normally you would see another pair of expand-arrows (if all rows would have the record in them).
This is the workaround: http://www.thebiccountant.com/2017/07/25/how-to-expand-a-column-that-cannot-be-expanded-in-power-bi-and-power-query-in-excel/