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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Niraj_vora0106
Helper III
Helper III

Concatenation in M-query

Hi community,

 

How to Concatenate in M-query.?

I tried using Merge feature.

Tried using "&" too but didn't work!

 

I've three columns that I want to concat,

Day/Month/Year

 

Is there any way on how to do it using M-query functions?

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Niraj_vora0106 

 

To concatenate multiple values with "&", you need to ensure every value is of Text type. You can change all column types to Text before concatenating. Or if you want to keep their original non-Text type, you can use Text.From() function to convert column type temporarily when concatenating. 

 

In the following example, Day and Year columns are of Whole number type. 

Text.From([Day]) & "/" & [Month] & "/" & Text.From([Year])

vjingzhang_0-1646187352195.png

 

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

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Niraj_vora0106 

 

To concatenate multiple values with "&", you need to ensure every value is of Text type. You can change all column types to Text before concatenating. Or if you want to keep their original non-Text type, you can use Text.From() function to convert column type temporarily when concatenating. 

 

In the following example, Day and Year columns are of Whole number type. 

Text.From([Day]) & "/" & [Month] & "/" & Text.From([Year])

vjingzhang_0-1646187352195.png

 

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

Hi @v-jingzhang 

 

The formula that you suggested worked really well.

Thank you.

VijayP
Super User
Super User

@Niraj_vora0106 
You can use Text.Combine({ first text, second Text,....}) and if you are combining any number keep that in " " for example "2" or "1" etc., and it works




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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