Forum Discussion
Anonymous
1 year agoNot applicable
Creating a Custom column based on Value from one column
Hi Guys, I am just starting off in Power BI, i have following query. I want to create custom column based on the values in another coumn of the same table. For example, if Orignal Column contai...
- 1 year ago
Hello,
By creating a custom column in powerBI and pasting the following dax query, you will return what you are looking for. (Note that you will need to add more rows for each of your conditions.
NewColumn = SWITCH( TRUE(), SEARCH("ABC", [OriginalColumn], 1, 0) > 0, "ABC", SEARCH("EST", [OriginalColumn], 1, 0) > 0, "EST", BLANK() -- Or you can add another condition here if needed by simply repeating the above lines )Please mark my answer as the solution if this works for you, feel free to respond if you need more clarification!
Have a great day
NHarington
1 year agoFrequent Visitor
Hello,
By creating a custom column in powerBI and pasting the following dax query, you will return what you are looking for. (Note that you will need to add more rows for each of your conditions.
NewColumn =
SWITCH(
TRUE(),
SEARCH("ABC", [OriginalColumn], 1, 0) > 0, "ABC",
SEARCH("EST", [OriginalColumn], 1, 0) > 0, "EST",
BLANK() -- Or you can add another condition here if needed by simply repeating the above lines
)
Please mark my answer as the solution if this works for you, feel free to respond if you need more clarification!
Have a great day