Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
User | Count |
---|---|
9 | |
7 | |
5 | |
5 | |
4 |
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |