Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello!
I need help please. I dont know how can I get what I need. I have this table:
| Order | Product Category |
1 | Sport |
| 1 | Fashion |
| 2 | Food |
| 2 | Sport |
I need to split the second column (Product Category) so I have this result:
| Order | Product Category 1 | Product Category 2 |
| 1 | Sport | Fashion |
| 2 | Food | Sport |
I tried crating a new column from example but it does not work.
The idea is to check the patterns of mix between the orders. Thanks for your help!
Kind regards
Solved! Go to Solution.
1) Duplicate "Order"-column
2) Pivot on that new column with "Product Category" as Values-column. Adjust aggregation settings to "no aggregation"
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @Anonymous ,
You could try below M code to se whether it work or not
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQouyC8qUYrVgfDcEoszMvPzwHwjED8/PwXOgSqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Order = _t, #"Product Category" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Order", Int64.Type}, {"Product Category", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Order"}, {{"Product Category", each Text.Combine([Product Category], ","), type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Grouped Rows", "Product Category", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Product Category.1", "Product Category.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Product Category.1", type text}, {"Product Category.2", type text}})
in
#"Changed Type1"
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Similar to this:
https://community.powerbi.com/t5/Power-Query/Duplicated-rows-to-columns/m-p/1013664#M34490
Kind regards,
JB
Hi @Anonymous ,
Similar to this:
https://community.powerbi.com/t5/Power-Query/Duplicated-rows-to-columns/m-p/1013664#M34490
Kind regards,
JB
Hi @Anonymous ,
You could try below M code to se whether it work or not
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQouyC8qUYrVgfDcEoszMvPzwHwjED8/PwXOgSqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Order = _t, #"Product Category" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Order", Int64.Type}, {"Product Category", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Order"}, {{"Product Category", each Text.Combine([Product Category], ","), type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Grouped Rows", "Product Category", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Product Category.1", "Product Category.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Product Category.1", type text}, {"Product Category.2", type text}})
in
#"Changed Type1"
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1) Duplicate "Order"-column
2) Pivot on that new column with "Product Category" as Values-column. Adjust aggregation settings to "no aggregation"
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.