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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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