Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi - I would like to do the following - create a row for each value in a field.
Example:
| ID | Food Type |
| 1 | Ice Cream; Cake; Cookies |
| 2 | Apples; Bananas; Pears; Peaches |
| 3 | Pizza |
Output:
| ID | Food Type |
| 1 | Ice Cream |
| 1 | Cake |
| 1 | Cookies |
| 2 | Apples |
| 2 | Bananas |
| 2 | Peaches |
| 2 | Pears |
| 3 | Pizza |
Therefore, the ";" indicates a new record (so to speak) - any thoughts ? Jerry
Solved! Go to Solution.
Source
You turn the string into a List, and then expand it:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfJMTlVwLkpNzLVWcE7MTgWS+fnZmanFSrE60UpGQAWOBQU5qcXWCk6JeUAIZASkJhZBqOQMqDpjoLqAzKqqRKXYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Food Type" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Food Type", type text}}),
#"Create List" = Table.TransformColumns(#"Changed Type",{"Food Type", each Text.Split(_,";"),type {text}}),
#"Expanded Food Type" = Table.ExpandListColumn(#"Create List", "Food Type")
in
#"Expanded Food Type"
Result
@jerryr125 Many ways to solve this, here is one using List.TransformMany
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfJMTlVwLkpNzLVWcE7MTgWS+fnZmanFSrE60UpGQAWOBQU5qcXWCk6JeUAIZASkJhZBqOQMqDpjoLqAzKqqRKXYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Food Type" = _t]),
ChangedType =
Table.TransformColumnTypes ( Source, { { "ID", Int64.Type } } ),
Transform =
List.TransformMany (
Table.ToRows ( ChangedType ),
( z ) => Text.SplitAny ( z{1}, ";" ),
( x, y ) => { x{0}, y }
),
ToTable =
Table.FromRows (
Transform,
type table [ ID = Int64.Type, Food Type = text ]
)
in
ToTable
Hi @jerryr125 , you can solve this problem by UI, just select the column Food Type, go to the homw tab, select Split Column by delimiter and make the setting presented in the below picture (it is important to select by row)
Hi @jerryr125 , you can solve this problem by UI, just select the column Food Type, go to the homw tab, select Split Column by delimiter and make the setting presented in the below picture (it is important to select by row)
@jerryr125 Many ways to solve this, here is one using List.TransformMany
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfJMTlVwLkpNzLVWcE7MTgWS+fnZmanFSrE60UpGQAWOBQU5qcXWCk6JeUAIZASkJhZBqOQMqDpjoLqAzKqqRKXYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Food Type" = _t]),
ChangedType =
Table.TransformColumnTypes ( Source, { { "ID", Int64.Type } } ),
Transform =
List.TransformMany (
Table.ToRows ( ChangedType ),
( z ) => Text.SplitAny ( z{1}, ";" ),
( x, y ) => { x{0}, y }
),
ToTable =
Table.FromRows (
Transform,
type table [ ID = Int64.Type, Food Type = text ]
)
in
ToTable
Hi - I did a split then a unpivot and solved it - thanks so much - Jerry
Source
You turn the string into a List, and then expand it:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfJMTlVwLkpNzLVWcE7MTgWS+fnZmanFSrE60UpGQAWOBQU5qcXWCk6JeUAIZASkJhZBqOQMqDpjoLqAzKqqRKXYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Food Type" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Food Type", type text}}),
#"Create List" = Table.TransformColumns(#"Changed Type",{"Food Type", each Text.Split(_,";"),type {text}}),
#"Expanded Food Type" = Table.ExpandListColumn(#"Create List", "Food Type")
in
#"Expanded Food Type"
Result
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |