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

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.

Reply
Anonymous
Not applicable

Concatenate two column and create a new column using Power Query

Hi Experts,

I am trying to concanate two column using power query. I am unable to get the output. I have "Month" and "Year" two separate columns in my calender table. I wanted to merge those two columns and get the output like, "2019-Jan"

 

this is my script for same:

 

= Table.AddColumn(#"Changed Type2", "YYYYMM", each [Fin Month] & [Fin Year])

 

I am getting "error" as my column value.

 

I even tried to create a new columns using power query script directly from the "advanced editor"

 

#"Inserted MonthYearLong" = Table.AddColumn(#"Inserted MonthYearLong", "Year Month", each [Month] & "-" & Text.From([Year])),

 

I am not sure whats the best way to get output like 2019-Jan!

 

Would appreciate your help.

 

Thanks in advance.

 

 

 

 

 

 

 

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

You cannot refer same step's name inside the expression.

Use the previous step name

 

#"Inserted MonthYearLong" = Table.AddColumn(#"Inserted MonthYearLong", "Year Month", each [Month] & "-" & Text.From([Year])),
Anonymous
Not applicable

Hi Zubair Thanks for your response in relation to my above query. Now Ive referred previous step name. But still I am getting this error; Expression.Error: The column 'YYYYMM' of the table wasn't found. Details: YYYYMM #"Inserted First Characters1" = Table.AddColumn(#"Inserted First Characters", "DDD", each Text.Start([Day Name], 3), type text), #"Inserted MonthYearLong" = Table.AddColumn(#"Inserted First Characters1", "Year Month", each [Month] & "-" & Text.From([Year])), But I am getting error while I am trying to record the column details; #"Reordered Columns" = Table.ReorderColumns(#"Inserted First Characters1",{"Date", "Fin Year", "Month Name", "MMM", "YYYYMM", "Fin Month", "Day Name", "DDD", "Day of Week"}),

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.