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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
How Can I Unpivot a table where I have One Column for Order ID SKU1, SKU2, and SKU3 for SKUS Ordered and QTY1,QTY2 and QT3 for Quantities ?
Solved! Go to Solution.
Hi @akash412singh ,
I created a sample pbix file(see the attachment), please check if that is what you want.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUjYxMTYxMlXSUQpJTQSSEGQEZcXqwFSYAbnuIfHO+blJ+XBlhhjKzEGiCs75aWmpqXiUWQC5xujKMFRZArmuQCVFZanFyal5JQohjk7BCuGpmekZJTh1GRtguBS/GYao2g2x+QDDEiNUDxDlSoRuY7I8ZoIWSRgKQLGYnF/unpGaamhgYIBboRnYpLyU1CLn/OT8vNIScLyhRVYsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Order Number" = _t, SKU.1 = _t, SKU.2 = _t, SKU.3 = _t, QTY.1 = _t, QTY.2 = _t, QTY.3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Order Number", type text}, {"SKU.1", type text}, {"SKU.2", type text}, {"SKU.3", type text}, {"QTY.1", Int64.Type}, {"QTY.2", Int64.Type}, {"QTY.3", type text}}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"SKU.1", "SKU.2", "SKU.3"}, "SKUs", "SKU Value"),
#"Unpivoted Only Selected Columns1" = Table.Unpivot(#"Unpivoted Only Selected Columns", {"QTY.1", "QTY.2", "QTY.3"}, "QTY Type", "QTY")
in
#"Unpivoted Only Selected Columns1"
In addition, you can refer the following links to get it.
Best Regards
Hi @akash412singh ,
I created a sample pbix file(see the attachment), please check if that is what you want.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUjYxMTYxMlXSUQpJTQSSEGQEZcXqwFSYAbnuIfHO+blJ+XBlhhjKzEGiCs75aWmpqXiUWQC5xujKMFRZArmuQCVFZanFyal5JQohjk7BCuGpmekZJTh1GRtguBS/GYao2g2x+QDDEiNUDxDlSoRuY7I8ZoIWSRgKQLGYnF/unpGaamhgYIBboRnYpLyU1CLn/OT8vNIScLyhRVYsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Order Number" = _t, SKU.1 = _t, SKU.2 = _t, SKU.3 = _t, QTY.1 = _t, QTY.2 = _t, QTY.3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Order Number", type text}, {"SKU.1", type text}, {"SKU.2", type text}, {"SKU.3", type text}, {"QTY.1", Int64.Type}, {"QTY.2", Int64.Type}, {"QTY.3", type text}}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"SKU.1", "SKU.2", "SKU.3"}, "SKUs", "SKU Value"),
#"Unpivoted Only Selected Columns1" = Table.Unpivot(#"Unpivoted Only Selected Columns", {"QTY.1", "QTY.2", "QTY.3"}, "QTY Type", "QTY")
in
#"Unpivoted Only Selected Columns1"
In addition, you can refer the following links to get it.
Best Regards
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |