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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

IF statement multiply value based on text in other column

Hi all,

 

I want to make an IF statement in Power Query that would multiply the number that I have in a column called ALG_Prijs, but it should only be multiplied when the a column named ALG_Detail contains the word "chair".

I have been trying for quite some time now, but I can't get it to work. 

Anyone have any ideas?

 

Thanks! 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use following in a custom column where you will need to replace "Your number" appropriately. 

= if Text.Contains([ALG_Detail],"chair",Comparer.OrdinalIgnoreCase) then [ALG_Prijs]*"Your number" else null

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

Use following in a custom column where you will need to replace "Your number" appropriately. 

= if Text.Contains([ALG_Detail],"chair",Comparer.OrdinalIgnoreCase) then [ALG_Prijs]*"Your number" else null

Anonymous
Not applicable

It seems to work, apart from the moment where it shows "Error" in the new column. Once I click on it, I get this message: Expression.Error: We cannot apply operator * to types Number and Text.

Did you replace "Your number" with an approriate column or number? And also make sure that [ALG_Prijs] and "Your number" contains number only.

If still the problem, please paste your query and some sample data here.

Anonymous
Not applicable

It worked! Thank you!

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.

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.