Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a table with four columns: A, B, C, D.
<A> <B> <C> <D>
John Mike Mark Robyn
Maura Deb Jim Tim
I would like to create a new table with all the raws that include the relations between A and all of Columns B, C, D.
I would like to generate a new table with two columns including all the raws from the table with column A & B, append the same table with columns A & C and do the same with column A & D.
<A> <New>
John Mike
John Mark
John Robyn
Maura Deb
Maura Jim
Maura Tim
I tried the funciton summarize and union but wasn't able to link the columns B, C, D to the new column.
Any chance you could help?
Thanks a lot !
Solved! Go to Solution.
HI, @Anonymous
The best way is Unpivot the columns in Edit Queries.
For example:
In Edit Queries, Selected Column B,C,D.
Then click Transform->Unpivot Columns
Now remove Attribute column.
Result:
here is M colde, please try it.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFPSUfLNzE4FUYlF2UAqKD+pMk8pVicaKFBalAgUcUlNApJemblAMgRIxsYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t, D = _t]), #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"A"}, "Attribute", "Value"), #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}) in #"Removed Columns"
Best Regards,
Lin
HI, @Anonymous
The best way is Unpivot the columns in Edit Queries.
For example:
In Edit Queries, Selected Column B,C,D.
Then click Transform->Unpivot Columns
Now remove Attribute column.
Result:
here is M colde, please try it.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFPSUfLNzE4FUYlF2UAqKD+pMk8pVicaKFBalAgUcUlNApJemblAMgRIxsYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t, D = _t]), #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"A"}, "Attribute", "Value"), #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}) in #"Removed Columns"
Best Regards,
Lin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |