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:
amitchandak
6 years agoSuper User
Anonymous , these three M operations should give you desired results
Text.Split
https://docs.microsoft.com/en-us/powerquery-m/text-split
List.FindText
https://docs.microsoft.com/en-us/powerquery-m/list-findtext
Text.Combine
https://docs.microsoft.com/en-us/powerquery-m/text-combine