Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Join a letter to a column in Power Query

Community

Please ask for your help with knowing how to write the formula in Power Query if I want to generate a new column with the one letter along with the value of a current column.

Example:

"S" [Center], where S is the letter and [Center] is the column of a current table.

Currently I enter it like this but it generates error.

Stay tuned

Saludso

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

Pls refer the below:

vluwangmsft_0-1652862073293.png

If the column is number ,use the below to create a new column ,then delete before column and rename new column:

"S"&Number.ToText([Center1])

vluwangmsft_1-1652862336695.png

If the column is text,use the below to create a new column ,then delete before column and rename new column:

"S"&[Cebter2]

vluwangmsft_2-1652862381927.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

5 REPLIES 5
v-luwang-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

Pls refer the below:

vluwangmsft_0-1652862073293.png

If the column is number ,use the below to create a new column ,then delete before column and rename new column:

"S"&Number.ToText([Center1])

vluwangmsft_1-1652862336695.png

If the column is text,use the below to create a new column ,then delete before column and rename new column:

"S"&[Cebter2]

vluwangmsft_2-1652862381927.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Syndicate_Admin
Administrator
Administrator

I finally discovered the error.

To be able to create a concatenated column in PQ, it must only be text, IT CANNOT BE NUMBER

Syndicate_Admin
Administrator
Administrator

What I need is to join "S" & (Center)

But it gives me error as seen in the following image:

csalinas23_0-1652376364481.png

ribisht17
Super User
Super User

@Syndicate_Admin 

 

StepName = Table.TransformColumns(
  Source,
  {
    {
      "name", 
      each 
        Text.Combine({"ABC",(_)}),
      type text
    }
  }
)

>>>REFER >>> Add Text to an Existing Column in Power Query | jaykilleen.com

 

Regards,

Ritesh 

I still get an error "Eof token expected"

csalinas23_0-1652375818512.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.