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 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!
Solved! Go to Solution.
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
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
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.
It worked! Thank you!