Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Power query if statement help

Can someone please help me with the error on the attached picture? It seems as though I'm missing something simple, but can seem to be able to get the syntax right. 

  • Anonymous , you have " sign on wrong place (in front of field name).
    "[MRP Type]="ND" then ...
    it should be
    [MRP Type]="ND" then ...

     

    Regards,

    Nemanja Andic

3 Replies

  • smpa01's avatar
    smpa01
    Community Champion

    Anonymouscan you try it like this

    if ([Index]=1 and [val]<>null) then 1 else if ([Index]>1 and [val]<>null) then 2 else 0
  • nandic's avatar
    nandic
    Resident Rockstar

    Anonymous , you have " sign on wrong place (in front of field name).
    "[MRP Type]="ND" then ...
    it should be
    [MRP Type]="ND" then ...

     

    Regards,

    Nemanja Andic

    • Anonymous's avatar
      Anonymous
      Not applicable

      That was it! Can't believe I didn't catch that. Thank you!!