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
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
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.