When writing an IF statement in Power query yo have to look for the add columns section and the 'Conditional Column'
![](https://www.thedataschool.co.uk/content/images/2023/08/image-274.png)
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
![](https://www.thedataschool.co.uk/content/images/2023/08/image-275.png)
This allows you to create your IF statement. an example conditional Column is below.
![](https://www.thedataschool.co.uk/content/images/2023/08/image-285.png)
This would then give the following output
![](https://www.thedataschool.co.uk/content/images/2023/08/image-287.png)
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'
![](https://www.thedataschool.co.uk/content/images/2023/08/image-287.png)