When writing an IF statement in Power query yo have to look for the add columns section and the 'Conditional Column'
This will load a window where you can create a conditional statement like with Tableau or Excel. However it is more structured than either of those systems.
The window that loads looks like this
This allows you to create your IF statement. an example conditional Column is below.
This would then give the following output
Its Also important to make sure that the conditional column is formatted to the data type that it contains, so in this example it would be a text, This would be achieved by left clicking on the "ABC123" on the top left hand side of the column and selecting 'text'