Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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 Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • dax's avatar
    dax
    Community 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 Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.