cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MandyL
Frequent Visitor

Can we split the text column into row?

Hi Team,

 

In the Power Query Editor page, it’s easy to use the “Split Column by Delimiter” button to transfer the Table A’s data to Table B. In the dataset view, it is not easy to do as we don’t have edit query permission in the Model view. In the "Report View" page, may I know is there any formula can split the text into row's view? So, in the "Report View" page, I can create a new column (based on the split formula), and display the Table B’s view. Thanks!

Are we able to split the text column into row?

Table A

ID

Member

ID_1

User A, User B

ID_2

User C, User D, User E

 

Table B

ID

Member

ID_1

User A

ID_1

User B

ID_2

User C

ID_2

User D

ID_2

User E

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @MandyL 
Please refer to attached sample file with the solution

1.png

TableB = 
GENERATE ( 
    VALUES ( TableA[ID] ),
    VAR String = CALCULATE ( SELECTEDVALUE ( TableA[Member] ) )
    VAR Items = SUBSTITUTE ( String, ", ", "|" )
    VAR Length = PATHLENGTH ( Items )
    VAR T = GENERATESERIES ( 1, Length, 1 )
    RETURN
        SELECTCOLUMNS ( T, "Member", PATHITEM ( Items, [Value] ) )
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @MandyL 
Please refer to attached sample file with the solution

1.png

TableB = 
GENERATE ( 
    VALUES ( TableA[ID] ),
    VAR String = CALCULATE ( SELECTEDVALUE ( TableA[Member] ) )
    VAR Items = SUBSTITUTE ( String, ", ", "|" )
    VAR Length = PATHLENGTH ( Items )
    VAR T = GENERATESERIES ( 1, Length, 1 )
    RETURN
        SELECTCOLUMNS ( T, "Member", PATHITEM ( Items, [Value] ) )
)

Thank you so much for your help. 😊

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors