Forum Discussion
Adding multiple entries for each record in a sumamrized table
- 6 years ago
It is easier to do this in the Query Editor. Please paste this in a blank query (Advanced Editor, replace the existing text with this)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyaKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {"Learning Community", "Feedback", "Engagement"}),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type text}})
in
#"Changed Type1"It adds a List with your three values to each of the rows and then expands to new rows to get your desired result.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years ago
Thanks so much mahoneypat such a nice solution in m.
Greatly appreciated
It is easier to do this in the Query Editor. Please paste this in a blank query (Advanced Editor, replace the existing text with this)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyaKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {"Learning Community", "Feedback", "Engagement"}),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type text}})
in
#"Changed Type1"
It adds a List with your three values to each of the rows and then expands to new rows to get your desired result.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Thanks so much mahoneypat such a nice solution in m.
Greatly appreciated