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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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