Forum Discussion
IF statement with divides in powerquery
Hello!, im trying to make a column that divides the Tariff by one column if its under a certain value and divides by the other when its above said value. Ive been trying to get it to work but the internet isn't currently helping me out that much. Their normal if statements don't allow for divides.
Statement:
if([Tarriff] > 9000 Then [Tariff]/[amountill] Else [Tariff]/[AmountFrom]
fields are all numerical and i checked for case sensitivity. anything obvious im doiung wrong?
Hi Anonymous ,
Yes, as above mentioned, you need to pay attention to case sensitive. And you also need to pay attention to "(", you could remove it if condition is simple. You could refer to below image and change this to your condition.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- HotChilliCommunity Champion
if, then and else have to be written in lower case
- daxCommunity Support
Hi Anonymous ,
Yes, as above mentioned, you need to pay attention to case sensitive. And you also need to pay attention to "(", you could remove it if condition is simple. You could refer to below image and change this to your condition.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.