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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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