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
Anonymous
Not applicable

Use Table header as the column name in a merge query

I want to use the Table header value as the column name in a merge query I have (from a previous question)

 

#"Merged Columns" = Table.CombineColumns(#"Trimmed Text",mergeHeaders[headers],Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"Merged")

 

I have tried replacing Merged with mergeHeaders[headers]  but get the error

 

Expression.Error: We cannot convert a value of type List to type Text.
Details:
    Value=[List]
    Type=[Type]

 

 

I have also tried mergeHeaders[headers]{0} I get no error but the merge no longed outputs data

 

Thank you

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use this in place of mergeHeaders[headers]

 

Text.BetweenDelimiters("mergeHeaders[headers]","[","]")

 

Note - For this merge to work, you require at least 2 column names which exist in #"Trimmed Text". This result should appear in the place where you would place this. Refer the doc here - https://docs.microsoft.com/en-us/powerquery-m/table-combinecolumns 

 

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Use this in place of mergeHeaders[headers]

 

Text.BetweenDelimiters("mergeHeaders[headers]","[","]")

 

Note - For this merge to work, you require at least 2 column names which exist in #"Trimmed Text". This result should appear in the place where you would place this. Refer the doc here - https://docs.microsoft.com/en-us/powerquery-m/table-combinecolumns 

 

Anonymous
Not applicable

Yes, that's great! Thank you again

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.