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
Anonymous
Not applicable

How to: IF statement then a columnA+columnB in power query

Hi All,

 

Hope you are doing great. 
I tried to have a custom column where when Column X ="x" then Column A + Column B else Column A + Column C

But it throw me an error. Down below I include a screenshot for better understanding of my question:

nasriq_0-1646910451568.png

 

Need help in this. Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

It looks like you are trying to concatenate data.

This is usually due to you having a column that is not in text format, possibly in numeric format.

Try to use Number.ToText function to format the numeric value number to a text value

vstephenmsft_2-1647420110418.png

 

vstephenmsft_3-1647420115946.png

 

 

 

Best Regards,

Stephen Tao

 

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

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

It looks like you are trying to concatenate data.

This is usually due to you having a column that is not in text format, possibly in numeric format.

Try to use Number.ToText function to format the numeric value number to a text value

vstephenmsft_2-1647420110418.png

 

vstephenmsft_3-1647420115946.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try removing these brackets:

BA_Pete_0-1646911443708.png

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Tried that, but still the same.

nasriq_0-1646912088144.png

 

Hi @Anonymous ,

 

Try using this:

 

if [Source Name] = "MFGPRO" then [Source Transformed] & [#"Vendor ID & Domain"]
else [Source Transformed] & [Vendor ID]

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




You need to use smallcase in If, hence just replace If with if and problem will be solved. You have already corrected the syntax using Ba_Pete's suggestions. 

Helpful resources

Announcements
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.

Top Kudoed Authors
Users online (11,414)