Forum Discussion

324's avatar
324
Helper I
4 years ago
Solved

How can I create a concatenation between a string and a specified number?

I have been trying to create a column that is a concatenation between the year and the ID for a column (e.g., "2022" + [ID]).

 

I've tried a few things including CONCATENATE("2022", [ID]), but I keep getting errors. What is the correct way to do something like this?

 

My end goal is to append the data from several SharePoint Lists.

 

Appologies if this is an easy question, I am brand new to Power BI.

  • Hi 324 

     

    You can use operator & to concatenate two values in Power Query. Take notice that the values on both sides should be Text type, otherwise it will cause error. You can use functions like Text.From(), Number.ToText(), .etc to convert other type values to Text type when concatenating. For example,

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

2 Replies

  • Hi 324 ,

    In Power BI, adding a calculated column using CONCATENATE should work.

    In Power Query editor you could try something like this:

     

     

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi 324 

     

    You can use operator & to concatenate two values in Power Query. Take notice that the values on both sides should be Text type, otherwise it will cause error. You can use functions like Text.From(), Number.ToText(), .etc to convert other type values to Text type when concatenating. For example,

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.