Forum Discussion
Anonymous
6 years agoNot applicable
extract values from comma separated values
Hi All, I have data in below format : ID(unique) Name 1 App1,App2,App3,Code1 2 App2,App6,DevCode 3 null 4 Abc The output should be : ID(unique...
- 6 years ago
Hey Anonymous ,
as requested here is a DAX solution.
Based on my sample data:
I created this calculated column, as DAX does not allow to overwrite existing values.
Name new = var _path = SUBSTITUTE('Table'[Name] , "," , "|" ) var _pathlength = PATHLENGTH(_path) var _newstring = CONCATENATEX( FILTER( ADDCOLUMNS( GENERATESERIES(1 , _pathlength) , "_name" , PATHITEM(_path, ''[Value]) ) , LEFT([_name], 3) = "App" ) , [_name] , "," ) return _newstringThe following screenshot shows the table with the new column:
TomMartens
6 years agoSuper User
Hey Anonymous ,
as requested here is a DAX solution.
Based on my sample data:
I created this calculated column, as DAX does not allow to overwrite existing values.
Name new =
var _path = SUBSTITUTE('Table'[Name] , "," , "|" )
var _pathlength = PATHLENGTH(_path)
var _newstring =
CONCATENATEX(
FILTER(
ADDCOLUMNS(
GENERATESERIES(1 , _pathlength)
, "_name" , PATHITEM(_path, ''[Value])
)
, LEFT([_name], 3) = "App"
)
, [_name]
, ","
)
return
_newstring
The following screenshot shows the table with the new column:
- Anonymous6 years agoNot applicable
Thank you. It worked. 🙂