Forum Discussion

VrowePPA's avatar
VrowePPA
Frequent Visitor
3 years ago
Solved

Create New Column with If Text Contains parameters

I'm sorry, I have read all the 'text contains' articles and have tried the formulas for my data, but I just can't get my formula to work!

 

I have a table with a field with six possible values:

New Warm, New Hot, New Cold, Existing Warm, Existing Hot, Existing Cold

 

I want to create a visual that just shows me a pie chart of "new" vs "existing". So, I'm trying to create a custom column where If the value is either New Warm, New Hot or New Cold, then just give me a value of "New", else "Existing".

 

I've tried formulas for containsstring, contains.text etc.. I always get these two errors.

It doesn't recognise "IF"

 

If I add an =, then I get the literal token message

 

Thanks in advance for pointing me in the right direction.

 

Vikki

 

 

  • Hi, I am not sure if I understood your question correctly, but please try something like below.

    One thing to note is that Uppercase and lowercase has to be exactly the same, when using Power Query Editor.

     

     

     

2 Replies

  • Hi, I am not sure if I understood your question correctly, but please try something like below.

    One thing to note is that Uppercase and lowercase has to be exactly the same, when using Power Query Editor.

     

     

     

  • VrowePPA's avatar
    VrowePPA
    Frequent Visitor

    Thank you, yes your example is the result I am trying to achieve. Your insutrction helped the formula to run. However, I still get an error: A cyclic reference was encountered during evaluation.