Forum Discussion
SysLostInBI
6 years agoFrequent Visitor
Working with JSON and multiple List
I'm sure this is a very basic question, so I feel bad bothering you with this. But I'm stuck with this. I have imported a JSON file: { "result": [ { "metricId": "xx"...
- 6 years ago
Many thanks. I actually watched the first video you are referencing just before posting this question 🙂 it does not contain the answer sadly.
I also watched https://www.youtube.com/watch?v=-QO57RHzxus which was quite helpful for the first few steps.Now, after posting this I just found this:
https://community.powerbi.com/t5/Desktop/How-to-expand-multiple-columns-to-new-rows-at-the-same-time/m-p/727833#M351265Which seems to solve my problem!
Mariusz
6 years agoCommunity Champion
Hi SysLostInBI
Try this steps
let
Source = Json.Document(File.Contents("C:\Users\mrepczynski\OneDrive - Network Homes\Desktop\test.json")),
result = Source[result],
result1 = result{0},
data = result1[data],
Custom1 = Table.FromRecords( data ),
#"Transposed Table" = Table.Transpose(Custom1),
#"Added Custom" = Table.AddColumn(#"Transposed Table", "Custom", each List.Combine( { [Column1], [Column2] } )),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
Custom = Table.FromRows( List.Zip( #"Removed Other Columns"[Custom] ) )
in
Custom
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.