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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
o59393
Post Prodigy
Post Prodigy

Concatenate text and numbers with Power Query

Hi all

 

I am doing a concatenation of text and numbers with power query, the formula I use is:

 

if [#"[ L1.4 - Refillability ]"] ="Fountain" then [Refilability]&" "&[#"[L1.7 - Bev Category]"]&" "&[Size conversion]

else if [Container] = "TETRA" or [Container] = "CAN" then [Container]&" "&[#"[L1.7 - Bev Category]"]&" "&[Size conversion] 

else [Refilability]&" "&[Container]&" "&[#"[L1.7 - Bev Category]"]&" "&[Size conversion]

 

The error I get it is:

 

Expression.Error: We cannot apply operator & to types Text and Number.

 

The [size conversion] is in number format. I tried on my code number.toText ([Size conversion]) but still got an error.

 

sssadadad.JPG

How can I fix my code while leaving size conversion as number and not text?


Thanks.

1 ACCEPTED SOLUTION

Hi @o59393 

Your [size conversion] is already a text column, please do not use "Number.ToText" before this column.

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

4 REPLIES 4
amitchandak
Super User
Super User

@o59393 , Try using Number.ToText on numeric datatype

 

https://docs.microsoft.com/en-us/powerquery-m/number-totext

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks

Hi @amitchandak 

 

I did add it and got an error

 

 

if [#"[ L1.4 - Refillability ]"] ="Fountain" then [Refilability]&" "&[#"[L1.7 - Bev Category]"]&" "&Number.ToText([Size conversion])

else if [Container] = "TETRA" or [Container] = "CAN" then [Container]&" "&[#"[L1.7 - Bev Category]"]&" "&Number.ToText([Size conversion])

else [Refilability]&" "&[Container]&" "&[#"[L1.7 - Bev Category]"]&" "&Number.ToText([Size conversion])

 

 

Error is:

sadasdadssaa.JPG

 

Thanks!

Hi @o59393 

Your [size conversion] is already a text column, please do not use "Number.ToText" before this column.

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.