Forum Discussion
Split a string of values into Columns
- Anonymous3 years ago
Hi Tamerj,
i have created a measure same as mentioned. I assume that it returns the table but somehow i am not able to see any thing. Do i need to create any table prior to this?
RLS_Key =VAR String = "P1,P2,P3" -- place your sting hereVAR Items =SUBSTITUTE ( String, ",", "|" )VAR Length =COALESCE ( PATHLENGTH ( Items ), 1 )VAR T1 =GENERATESERIES ( 1, Length, 1 )RETURNSELECTCOLUMNS (T1,"Project",PATHITEM(Items,[Value]))Could you please clarify.
Anonymous
I don't fully understand but you may create a table using the following DAX
List =
VAR String = "P1,P2,P3" -- place your sting here
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T1 =
GENERATESERIES ( 1, Length, 1 )
RETURN
SELECTCOLUMNS ( T1, "Project", PATHITEM ( Items, [Value] ) )
Hi Tamerj,
i have created a measure same as mentioned. I assume that it returns the table but somehow i am not able to see any thing. Do i need to create any table prior to this?
- tamerj13 years ago
Community Champion
Anonymous
Again, I'm sorry but I really don't understand what is this string or what are you trying to achieve. However, the proposed DAX is for a calculated table as per your request not a for measure.- Anonymous3 years agoNot applicable
Thanks for your reply. As suggested instead of using as measure used the same in the Manager role. It is working as expected.