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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Mic1979
Post Partisan
Post Partisan

Test.Combine with List

Dear all,

 

I have a table with a lot of culumns, and I want to combine them in a dymamic way.

 

I am using then the following instructions:

 

Dollars_Columns_Selected_DOLLAR_Source1 = List.Select(Table.ColumnNames(Total_Sales_DOLLARS_New_Name_Source1), each Text.Contains(_, "$")),
Dollars_Columns_Selected_Volumes_Source1 = List.Select(Table.ColumnNames(Total_Sales_DOLLARS_New_Name_Source1), each Text.Contains(_, "Volumes")),
 
 Headers_Source1  = Table.ColumnNames(Total_Sales_DOLLARS_New_Name_Source1),
 HeadersToRemove_Source1 = List.Combine({Dollars_Columns_Selected_DOLLAR_Source1,Dollars_Columns_Selected_Volumes_Source1}),
HeaderDifference_Source1    = List.Difference(Headers_Source1,HeadersToRemove_Source1),
 
Helper_Source1 = Table.AddColumn (
Total_Sales_DOLLARS_New_Name_Source1,
"Helper_Source1",
each Text.Combine (HeaderDifference_Source1, "")
)
 
I got a column with the concatenation, however the values in it are the names of the columns concatenated, and not the values in each of the column.
I know I need to use the following something similar to this:
 
each Text.Combine({
Record.Field(_, Input_Table_Column1),
Record.Field(_, Input_Table_Column2),
Record.Field(_, Input_Table_Column3),
Record.Field(_, Input_Table_Column4),
Record.Field(_, Input_Table_Column5)}, " ")
 
but I don't know how to do that using the variable HeaderDifference_Source1 to make this concatenation dynamic.
 
Thanks.
 
 
 
1 ACCEPTED SOLUTION
ZhangKun
Super User
Super User

Helper_Source1 = Table.AddColumn (
	Total_Sales_DOLLARS_New_Name_Source1,
	"Helper_Source1",
	each Text.Combine(
		List.Transform(HeaderDifference_Source1, (fn) => Record.Field(_, fn)), 
		""
	)
)

View solution in original post

2 REPLIES 2
ZhangKun
Super User
Super User

Helper_Source1 = Table.AddColumn (
	Total_Sales_DOLLARS_New_Name_Source1,
	"Helper_Source1",
	each Text.Combine(
		List.Transform(HeaderDifference_Source1, (fn) => Record.Field(_, fn)), 
		""
	)
)

Perfect. Many thanks.

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.