Forum Discussion
hermanos
3 years agoFrequent Visitor
Split Text After Second Value with Dax
Hi guys, I have a sample dataset which contains mail adresses of our users. For example; car@[email protected] ships@[email protected] [email protected] [email protected] If I have "car" in my e-mail address...
AlB
Community Champion
3 years agohermanos
It would be better to do this in Power Query. Try this other version
NewColumn =
SWITCH (
TRUE (),
SEARCH ( "ships", TableName[Address],, 0 ) > 0,
LEFT (
TableName[Address],
VAR aux_ =
FIND ( "@", TableName[Address], SEARCH ( "@", TableName[Address],, 0 ) + 1, 0 )
RETURN
IF ( aux_ = 0, LEN ( TableName[Address] ), aux_ )
),
SEARCH ( "cars", TableName[Address],, 0 ) > 0,
LEFT (
TableName[Address],
VAR aux2_ =
SEARCH ( "@", TableName[Address],, 0 )
RETURN
IF ( aux2_ = 0, LEN ( TableName[Address] ), aux2_ )
),
TableName[Address]
)