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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Split Column with two data types into rows

Hi, 

I am a new Power query user so apologies if this is already covered somewhere else.

 

I have a column with two data types. One is a system code and another is the product description. They are in a table, tabulated in rows, sharing the same order ID and date of order. There are other columns with data.

 

Example

Date                     Order ID              Code      

01/01/2021          1034                   126u78-15345

01/01/2021          1034                   Gucci handbag black

 

See screenshot for the actual table

 

I want to 'group them together so that the Gucci Handbag Black will go into a separate column but in the same row with 126u78-15345 so there's only one row.

 

Thanks in advance!

 

 

data.png

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

One way to do it would be to merge the table on itself then remove defunct rows:

 

1) Go to Home tab > Merge Queries

2) In the merge dialog, select your [OrderID] field, then Ctrl+click your [CreatedOnUtc] field. You should see a little 1 and 2 appear on these column headers in the preview.

3) For the second table in the dialog, select the same table again - it will have '(current)' next to it.

4) Select the same columns in the same way in the same order.

5) Select Left Outer as merge type. Hit OK.

6) Expand [OrderGuid] from the nested merged table

7) Create a new filter step something like this:

= Table.SelectRows(previousStep, each [storeId] <> null and [orderGuid] <> [orderGuid.1])

 

It's a bit of a hack, but quick and easy to explain/implement.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

One way to do it would be to merge the table on itself then remove defunct rows:

 

1) Go to Home tab > Merge Queries

2) In the merge dialog, select your [OrderID] field, then Ctrl+click your [CreatedOnUtc] field. You should see a little 1 and 2 appear on these column headers in the preview.

3) For the second table in the dialog, select the same table again - it will have '(current)' next to it.

4) Select the same columns in the same way in the same order.

5) Select Left Outer as merge type. Hit OK.

6) Expand [OrderGuid] from the nested merged table

7) Create a new filter step something like this:

= Table.SelectRows(previousStep, each [storeId] <> null and [orderGuid] <> [orderGuid.1])

 

It's a bit of a hack, but quick and easy to explain/implement.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

That's perfect.

 

Thank you Pete!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.