Search code examples
powerquerym

Cast a column to a different type in PowerQuery


I have the following query to combined two fields of different types:

= Table.AddColumn(#"New Column", "Calculated Column", each [Age] + [#"New-Name"])

Age is a number, and New-Name is a text field. However, I would like to cast the Age to a text field to concatenate the two fields together. How would I do this?


Solution

  • Try this

    = Table.AddColumn(#"New Column", "Calculated Column", each  Text.From([Age]) & [#"New-Name"])
    

    Text.From to cast as text

    & to concatenate