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
Hello all!
I brought in my data and did a few transformations up to #filtered Rows. After that step, there is code to create a list to merge paired rows (bad data that I had to fix).
The problem I am having now is with the #"Combine with Original Table" step. I need it to place the newly create list in the same position in the table as "Personnal Category" (which is one of the promoted headers) while retaining all the previous transformations promoted headers, change type and filtered row.
Please help!?
Thanks so much!!
let
Source = Folder.Files("C:\Users\O81465\Downloads\OneDrive_2023-01-20\Mexico Ruben Dario - Control de Acceso\Mexico R&D - Control de Acceso\R&D 2022"),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Transform File" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9"}, {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9"}),
#"Promoted Headers" = Table.PromoteHeaders(#"Expanded Transform File", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Personnal Category", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Personnal Category] = "PRESTADOR DE " or [Personnal Category] = "SERVICIOS EXTERNO" or [Personnal Category] = "SERVICIOS INTERNO")),
#"Even Rows" = List.Alternate(#"Filtered Rows"[Personnal Category],1,1,1),
#"Odd Rows" = List.Alternate(#"Filtered Rows"[Personnal Category],1,1,0),
#"Combine Lists" = List.Transform(List.Zip({#"Even Rows",#"Odd Rows"}), each Text.Combine(_," ")),
#"Alternate with nulls" = List.Combine(List.Zip({#"Combine Lists", List.Repeat({null}, List.Count(#"Combine Lists"))})),
#"Combine with Original Table" = Table.FromColumns({#"Alternate with nulls"} & Table.ToColumns(Table.RemoveColumns(#"Changed Type",{"Personnal Category"})), Table.ColumnNames(#"Changed Type"))
in
#"Combine with Original Table"
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!