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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.