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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors