Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Guys, new to PowerBi and really need some help.
I have a table called Leads and it looks like the below:
Name | Job Title |
Joe Bloggs | Reporter Analyst |
James Cloney | Data Reporter |
I need to add a new column to this table based on predefined (i have a list myself) keywords from the Job Title column. For example, the above table should now look like this:
Name | Job Title | Main Title |
Joe Bloggs | Reporter Analyst | Reporter |
James Cloney | Data Reporter | Reporter |
As you can see the new column was based on taking the keyword "Reporter" from the Job title column and then putting that as a value on the Main Title column.
I know how to add a new column but not sure what functions I can use to populate the correct values in that column?
Any help would be much appreciated, thanks!
I would use a SWITCH(TRUE() statement and SEARCH or FIND
SWITCH(TRUE(),
SEARCH("Reporter",[Column]),"Reporter",
SEARCH("Something else",[Column]),"Booger",
"Some default value"
)
Thank you so much for your quick response.
When I selected to add a new column and then entered the below in the formula box it gave me below error:
Function 'SWITCH' does not support comparing values of type True/False with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
@Anonymous - OK, use this instead, sorry:
Wow that's amazing!
Quick question, if i have more keywords within the column can I just keep adding them on in the query?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |