Forum Discussion
Custom column IF ELSE, make ELSE accept original value
I want to create a new column using custom column.
newcolumn=
if [fullfillmentObject] = "abc" then "ABC"
else if [fullfillmentObject] = "def" then "DEF"
else if [fullfillmentObject] = "ghi" then "GHI"
else [fullfillmentObject] #HERE IS THE ISSUE
where ELSE will take the original value of 'fullfillmentObject'. Currently, I use NULL in ELSE statement..
3 Replies
- AlB
Community Champion
Hi Anonymous
So what is the issue exactly? You already have what you are describing
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs
Cheers
- AnonymousNot applicable
Please see the below DAX query
Column = SWITCH(TRUE(),AND(_Char[Char] = "ABC", _Char[Char] = "DEF"),_Char[Char],UPPER(_Char[Char])) - mahoneypat
Microsoft Employee
I would use this approach in your new column if you want to do it in query:
=if List.Contains({"abc", "def","ghi"}, [Value]) then Text.Upper([Value]) else [Value]
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat