Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Split a string of values into Columns

Hi All, I am using Embeded power BI, in the Username() i am getting list of values "A,B,C,D". When i am reading this it is considering as a string not as a list of values. Anyone come accross this s...
  • Anonymous's avatar
    Anonymous
    3 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 here
    VAR Items =SUBSTITUTE ( String, ",", "|" )
    VAR Length =COALESCE ( PATHLENGTH ( Items ), 1 )
    VAR T1 =GENERATESERIES ( 1, Length, 1 )
    RETURN
    SELECTCOLUMNS (T1,"Project",PATHITEM(Items,[Value]))
     
    Could you please clarify.