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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

add a new column in power query to combine year and quarter

jashandeepkaur_0-1692827614462.png

Hi everyone, i am trying to create a new column in PQ to combine year and quarter. 

i tried the below formula but it is giving me error. 

Year/Qtr = [Year] & "-" & [Quarter]

 

can you please help. 

 

jashandeepkaur_2-1692827833467.png

i got my year and quarter from the notified column. i used data tab to extract year, month and quarter. but now i cannot combine them. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

You can add a custom column, then try the following code

Text.From([Year])&"-"&Text.From([Quarter])

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
mussaenda
Super User
Super User

Hi @Anonymous ,

 

In Power Query, you cannot simply combine number and text data types.

Year and Quarter are number data type and "-" is text data type.

 

Here is one way of solving your issue. You will treat your numbers as text then you can concatenate them.

Year/Qtr = Number.ToText([Year]) & "-" & Number.ToText([Quarter])

 

JoeBarry
Solution Sage
Solution Sage

Hi @Anonymous 

 

Along with the answer from @Anonymous you can use the Merge Columns feature in the Transformation Tab. 

 

First Highlight the Year Column then the Quarter Column and press the Merge Column button. You will be prompted to enter a separator and a column name

 

Thanks

Joe

 

If this post helps, then please Accept it as the solution 

Anonymous
Not applicable

Hi @Anonymous 

You can add a custom column, then try the following code

Text.From([Year])&"-"&Text.From([Quarter])

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors