The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
How can I fix my code while leaving size conversion as number and not text?
Thanks.
Solved! Go to 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.
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:
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.
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |