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
Hello everyone,
I need help with manipulation in table.
I have a table:
| Product | Cat | Index |
| A | AA | 1 |
| A | AB | 2 |
| B | AA | 1 |
| C | AA | 1 |
| C | AB | 2 |
| C | AC | 3 |
And i have to manipulate with it, to get this:
| Product | 1 | 2 | 3 |
| A | AA | AB | |
| B | AA | ||
| C | AA | AB | AC |
Is this possible in power query?
Help guys
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXIEEYZKsTpQrhOQMAJznVBlnbFwEYrBXBBhrBQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Cat = _t, Index = _t]),
#"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Index]), "Index", "Cat"),
#"Replaced Value" = Table.ReplaceValue(#"Pivoted Column",null,"",Replacer.ReplaceValue,{"1", "2", "3"})
in
#"Replaced Value"
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXIEEYZKsTpQrhOQMAJznVBlnbFwEYrBXBBhrBQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Cat = _t, Index = _t]),
#"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Index]), "Index", "Cat"),
#"Replaced Value" = Table.ReplaceValue(#"Pivoted Column",null,"",Replacer.ReplaceValue,{"1", "2", "3"})
in
#"Replaced Value"
Hi,
you should try Dynamic Column option in Power Query. You can find it in the Transform menu of Power Query Editor.
I hope the answer has helped you, if true please mark the answer as correct!
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 |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |