Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi,
i have this data:
i have 4 rows for the same WTPARTNUMBER, the only different value is the column "MDP_PLM_Superse"
I want to transoform this into 1 row and X new columns based on "MDP_PLM_Superse".
I've tried with power query "pivot column" and "not aggregate" but it return me "compex data type" error.
Is this possible?
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
Can this help?
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Duplicate your last column. Select Pivot column on this new column and select for values your original last column. Don't aggregate.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSspJzFDSUcrPSwWSJeX5IDKjKBXEM1SK1cGrwIiQAmNCCkyUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", Int64.Type}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Column5", "Column5 - Copy"),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Duplicated Column", {{"Column5 - Copy", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Duplicated Column", {{"Column5 - Copy", type text}}, "en-US")[#"Column5 - Copy"]), "Column5 - Copy", "Column5")
in
#"Pivoted Column"
Hi,
this made a lot of column with the values name..
Hi @Anonymous ,
Can this help?
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
please demonstrate what you are trying to do with an example of what you are expecting as this isn't very clear.
Proud to be a Super User!
In SQL Server you can use the PIVOT function to transform the data from rows to columns: select Firstname, Amount, PostalCode, LastName, AccountNumber from ( select value, columnname from yourtable ) d pivot ( max(value) for columnname in (Firstname, Amount, PostalCode, LastName, AccountNumber) ) piv;
can you demonstrate what you are expecting and how many columns it creates?
Proud to be a Super User!
Like this
If there are other duplicates "WTPARTNUMBER" should be the same, columns will be "null" if are less
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 |
|---|---|
| 53 | |
| 40 | |
| 38 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 34 | |
| 33 | |
| 30 |