Forum Discussion
Extracting Specific Text from a String Type Column
- 6 years ago
Anonymous I don't why wouldn't post these rules in your original post, how someone will get to know what to do. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490Anyhow, add new column with following expression.
MyRegion = SWITCH ( TRUE(), SEARCH ( "EU", Table[Data], , -1 ) >= 0, "EU", SEARCH ( "Name", Table[Data], , -1) = -1 && SEARCH ( "NA", Table[Data], , -1 ) >= 0, "NA", SEARCH ( "APAC", Table[Data], , -1 ) >= 0, "APAC", "" )
Anonymous can you paste sample data here in a table?
I'll paste some sample values from this column:
Default-First-Site-Name
Azure-EU- North Europe ( I need EU from this value)
none
FR-Telecity
FIT
DE_MUC
TX95C
AWS-NA-East (I need just NA from this value)
- parry2k6 years agoSuper User
Anonymous is this the only value from which you don't want "NA" to extract?
- Anonymous6 years agoNot applicable
There are around 70,0000 rows of data in this dataset so there maybe other values that contain "na" in the value.
- parry2k6 years agoSuper User
Anonymous that raised the question what would be the logic to ignore not to extract "NA" , you have to have some logic, isn't it?