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
Hi, everyone, please help on this, I need table columnname as text, when I use this : Table.ColumnNames(table1)
it will show the value with list type. how can I CONVERT this list to text, thank you very much
Solved! Go to Solution.
Hi @Anonymous,
You can refer to below steps if it suitable for your requirement.
let
Source = Excel.Workbook(File.Contents("C:\Users\xxxxx\Desktop\test.xlsx"), null, true),
Sales_Sheet = Source{[Item="Sales",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sales_Sheet),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Month", Int64.Type}, {"Year", Int64.Type}, {"Amount", Int64.Type}}),
Custom= Lines.ToText(Table.ColumnNames(#"Changed Type"),",")
in
Custom
Screenshots:
Regards,
Xiaoxin Sheng
One way is to use the Text.Combine function by writing:
Text.Combine(Table.ColumnNames(#"Changed Type"),",")
If you only want the first item you could also use:
List.First(Table.ColumnNames(#"Changed Type"),",")
Hope that helps!
Rick
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
Hi @Anonymous,
You can refer to below steps if it suitable for your requirement.
let
Source = Excel.Workbook(File.Contents("C:\Users\xxxxx\Desktop\test.xlsx"), null, true),
Sales_Sheet = Source{[Item="Sales",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sales_Sheet),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Month", Int64.Type}, {"Year", Int64.Type}, {"Amount", Int64.Type}}),
Custom= Lines.ToText(Table.ColumnNames(#"Changed Type"),",")
in
Custom
Screenshots:
Regards,
Xiaoxin Sheng
Can you please provide an example. It is not clear from your post
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 171 | |
| 136 | |
| 119 | |
| 80 | |
| 54 |