Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Moving Text Document Rows to Additional Columns

I've got a text report from our Accounting folks that I'm trying to transform in Power Query.  I've cleaned out the junk and am left with this:

Batch 0001

Sample Account 10

Batch 0002

Sample Account 11
Sample Account 12
Batch 0003
Batch 0004
Sample Account 13
Sample Account 14
Sample Account 10
Batch 0005

I would like to move the Sample Account lines to a column alongside their batch with a desired output of

 

Batch 0001 Sample Account 10

Batch 0002 Sample Account 11

Batch 0002 Sample Account 12

Batch 0003

Batch 0004 Sample Account 13

Batch 0004 Sample Account 14

Batch 0004 Sample Account 10

 

If that isn't possible, I can make this output work for what I'm doing

 

Batch 0001 Sample Account 10

Batch 0002 Sample Account 11 Sample Account 12

Batch 0003

Batch 0004 Sample Account 13 Sample Account 14 Sample Account 10

 

I've tried pivoting and transposing but can't seem to get it exactly right.  Anyone know what to do here?  Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

vcgaomsft_0-1670915969929.png

1. Duplicate the table and follow these steps.

vcgaomsft_1-1670916046649.png

2. Then In Table -> Add a conditinoal column -> filter rows -> merge queries -> remove rows.

vcgaomsft_2-1670916182287.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

vcgaomsft_0-1670915969929.png

1. Duplicate the table and follow these steps.

vcgaomsft_1-1670916046649.png

2. Then In Table -> Add a conditinoal column -> filter rows -> merge queries -> remove rows.

vcgaomsft_2-1670916182287.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

wdx223_Daniel
Community Champion
Community Champion

=Table.Combine(Table.Group(PreviousStepName,"Column1",{"n",each Table.FromRows({[Column1]})}),0,(x,y)=>Byte.From(Text.StartsWith(y,"Batch")))[n])

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.