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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Buenas tardes:
Tengo una tabla denomida "Tabla Actual" cuya columna "nº" tiene valores repetidos y estos valores quería traspasarlos a columnas según la figura que adjunto.
Agradería ayuda para hacer la transformación usando power query en Power BI.
Muchas gracias.
West.
Solved! Go to Solution.
Hi @West ,
If I understand correctly, the issue is that you want to convert rows with duplicate values to columns. Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Click on Transform data.
3.Select the table and choose advanced editor.
4.Enter the following statement.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0ABLGSrE6EK4pEJvAeWZwOSOwuA6QhvHMwBjEMwaL6yhZgHkmYD1Ag8E8U7A4TKUpij5TFH0gniXEvlgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [N = _t, BI = _t, VA = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"N", Int64.Type}, {"BI", Int64.Type}, {"VA", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"N"}, {{"Count", each _, type table [N=nullable number, BI=nullable number, VA=nullable number]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Count],"Index",1)),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"BI", "VA", "Index"}, {"BI", "VA", "Index"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Count"}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Removed Columns", {"BI", "VA"}, "Attribute", "Value"),
#"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Unpivoted Only Selected Columns", {{"Index", type text}}, "en-US"),{ "Attribute","Index"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Merged"),
#"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value", List.Sum)
in
#"Pivoted Column"
5.The result is shown below.
Best Regards,
Wisdom Wu
Hi @West ,
If I understand correctly, the issue is that you want to convert rows with duplicate values to columns. Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Click on Transform data.
3.Select the table and choose advanced editor.
4.Enter the following statement.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0ABLGSrE6EK4pEJvAeWZwOSOwuA6QhvHMwBjEMwaL6yhZgHkmYD1Ag8E8U7A4TKUpij5TFH0gniXEvlgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [N = _t, BI = _t, VA = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"N", Int64.Type}, {"BI", Int64.Type}, {"VA", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"N"}, {{"Count", each _, type table [N=nullable number, BI=nullable number, VA=nullable number]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Count],"Index",1)),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"BI", "VA", "Index"}, {"BI", "VA", "Index"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Count"}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Removed Columns", {"BI", "VA"}, "Attribute", "Value"),
#"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Unpivoted Only Selected Columns", {{"Index", type text}}, "en-US"),{ "Attribute","Index"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Merged"),
#"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value", List.Sum)
in
#"Pivoted Column"
5.The result is shown below.
Best Regards,
Wisdom Wu
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.