Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Power BI – Record or table column from comma separated and list

How does one create a record or table from a comma separated value and a list of data?
The comma separated values are the keys and the list contains the data.

So far I have tried

= Record.FromList((Splitter.SplitTextByEachDelimiter({","})([columns])),[data])

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Expanding out the data and splitting the columns results in this:
enter image description here

>Solution :

Here you go.

enter image description here

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WStRJ0klWio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [columns = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"columns", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "list", each {1,2,3}),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom", each let a =  Text.Split([columns], ","),
b = Table.FromColumns({a, [list]})
in b),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"columns", "list"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2"}, {"Column1", "Column2"})
in
    #"Expanded Custom"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading