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 moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Scenario:
Current Table:
ID Date Topic
1 1.1.18 X;Y,Z
2 2.1.18 X;Z
Transform to:
ID Date Topic
1 1.1.18 X
1 1.1.18 Y
1 1.1.18 Z
2 2.1.18 X
2 2.1.18 Z
Any Ideas? Other Solutions in the Forum didn't help.
Solved! Go to Solution.
2 Ideas.
1. Choose some transform operations on the transform columns menu, e.g. "Trim"(in the "Format" group) and adjust the generated code.
let
Source = CurrentTable,
#"Splitted Text" = Table.TransformColumns(Source,{{"Topic", each Text.Split(_,";"), type {text}}}),
#"Expanded Topic" = Table.ExpandListColumn(#"Splitted Text", "Topic")
in
#"Expanded Topic"
2. Use split column with advanced option Split into rows. Resulting code (no adjustment required):
let
Source = CurrentTable,
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Topic", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Topic"),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Topic", type text}})
in
#"Changed Type"
2 Ideas.
1. Choose some transform operations on the transform columns menu, e.g. "Trim"(in the "Format" group) and adjust the generated code.
let
Source = CurrentTable,
#"Splitted Text" = Table.TransformColumns(Source,{{"Topic", each Text.Split(_,";"), type {text}}}),
#"Expanded Topic" = Table.ExpandListColumn(#"Splitted Text", "Topic")
in
#"Expanded Topic"
2. Use split column with advanced option Split into rows. Resulting code (no adjustment required):
let
Source = CurrentTable,
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Topic", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Topic"),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Topic", type text}})
in
#"Changed Type"
First split the Topic column by delimiter, in this case a semicolon.
Repeat this step on the second columkn that has been created but this time for a comma.
Select the Topic columns that have been created and press unpivot columns.
Remove the attribute column that was created from the unpivot and you have the end result.
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |