Forum Discussion
CarlsBerg999
Helper V
4 years agoCombining column and if sentence
Hi,
I'm trying to combine a basic column by using if sentences. However, this
=[Column1] & "/" & if [Column3] = null then [Column7] else ""
However, this produces error "Token Literal expetcted". What is wrong with this simple command..?
Thanks!
Just use Text.Combine Text.Combine - PowerQuery M | Microsoft Docs
The formula would be like this:
Text.Combine({[Column1], if [Column3] = null then [Column7] else ""}, "/")
2 Replies
- JirkaZ
Solution Specialist
Just use Text.Combine Text.Combine - PowerQuery M | Microsoft Docs
The formula would be like this:
Text.Combine({[Column1], if [Column3] = null then [Column7] else ""}, "/")
- AlexisOlson
Super User
All you need to do to fix this is put parentheses around the if statement so that it evaluates the expression in the order you intend.
= [Column1] & "/" & (if [Column3] = null then [Column7] else "")