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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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