Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nightfall
Helper I
Helper I

Append 4 columns of the same table into 2

Hello everybody!

I have the following table with 4 columns:

Costs | CValues | Revenues | RValues

cost1 | 100        | revenue1 | 40

cost2 | 50          | revenue2 |14
cost3.....

and i am trying to append costs and revenues and the respective values in 2 columns:
Costs + Revenues | CValues +Rvalues
cost1                     | 100
cost2                     |50
cost3....                  |....
revenue1               | 40
revenue2               | 14
revenue3.....           | ....

Since it is supposed to be the "Transform sample file", as far as i understand i cannot copy/duplicate the table and then append them...
Do you have any hints?

Thank you and best regards,

 

Vittorio

1 ACCEPTED SOLUTION

i.e. Your last step should be

 

 

#"new table" = Table.FromColumns({#"Removed Columns"[Column1]&#"Removed Columns"[Column3], #"Removed Columns"[Column2]&#"Removed Columns"[Column4]}, {"Conto","Importo"})

 

View solution in original post

5 REPLIES 5
Jakinta
Solution Sage
Solution Sage

I hope this can help...

 

NewTable = Table.FromColumns({Source[Costs]&Source[Revenues], Source[CValues]&Source[RValues]}, {"Costs + Revenues","CValues + Rvalues"})

 

If you apply it in transformation process, you can sort Costs + Revenues column upon invoking Transform Function. 

Hello @Jakinta thank you for your prompt reply.

it's giving me the following error:
Expression.Error: We cannot convert a value of type Table to type List.
Details:
Value=[Table]
Type=[Type]

 

the code is this:

let
Source = Excel.Workbook(Parameter1, null, true),
#"Doc 1" = Source{[Name="Doc 1"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(#"Doc 1",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", Int64.Type}, {"Column6", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Column5", "Column6"}),
#"new table" = Table.FromColumns(#"Removed Columns",{{Source[Column1]&Source[Column3], Source[Column2]&Source[Column4]}, {"Conto","Importo"}})
in
#"new table"

 

I will investigate on this.

 

Thank you again in the meantime.

 

Vittorio

If you replace Source in my line, with whichever step/table is the same structure as in your initial post, it should work.

i.e. Your last step should be

 

 

#"new table" = Table.FromColumns({#"Removed Columns"[Column1]&#"Removed Columns"[Column3], #"Removed Columns"[Column2]&#"Removed Columns"[Column4]}, {"Conto","Importo"})

 

i have soo much to learn...!!!! thank you a lot!!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.