The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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