Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Morning All
Im sure there is an easy way to do this.
Maybe using a switch function as that can cater for blanks?
I have a table that will have data like that in Table 1 Column 1
I want to add a new conditional column 2 which will do the following:
If it finds the String ITC then in the new conditional column it will output IT Component
If it finds the String APP then in the new conditional column it will output IT Application
Excel Mock Up
Table 1 – Current
Data Source |
APP-51059 |
APP-51026 |
APP-51037 |
APP-51040 |
ITC-92620 |
ITC-92338 |
ITC-92828 |
Table 2 – Required
Data Source | New Conditional Column |
APP-51059 | IT Application |
APP-51026 | IT Application |
APP-51037 | IT Application |
APP-51040 | IT Application |
ITC-92620 | IT Component |
ITC-92338 | IT Component |
ITC-92828 | IT Component |
Any pointers appreciated.
Jimmy
Solved! Go to Solution.
Hi @Anonymous ,
You can do this in Power Query as well with a conditional column, but if you want to add a DAX calculated column you can try this:
Conditional Column =
SWITCH(TRUE(),
CONTAINSSTRING(Source[Data Source],"APP"), "IT Application",
CONTAINSSTRING(Source[Data Source],"ITC"), "IT Component",
"Other")
You can replace "Other" with just "" if you want to show blanks on no match, and you can also expand the switch statement to search for additional strings and display a different result.
Proud to be a Super User! | |
Hi @Anonymous ,
You can do this in Power Query as well with a conditional column, but if you want to add a DAX calculated column you can try this:
Conditional Column =
SWITCH(TRUE(),
CONTAINSSTRING(Source[Data Source],"APP"), "IT Application",
CONTAINSSTRING(Source[Data Source],"ITC"), "IT Component",
"Other")
You can replace "Other" with just "" if you want to show blanks on no match, and you can also expand the switch statement to search for additional strings and display a different result.
Proud to be a Super User! | |
And here is how you would need to configure a conditional column in Power Query instead:
Hope this helps.
Proud to be a Super User! | |
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |