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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
talbi
New Member

Row transform nested values in one column and their corresponding nested values in another column

Faced with the challenge of transforming the following input table using Power Query.

The expected, output table is listed below.

What would be the steps to achieve such transformation.

Thank you

 

Raw input dat table to import into Power BI

 

DepartmentsCitiesRegionsOfficesCountries
SalesNew Deli|Madrid|BrusselsNational Capital Region,Castilla Leon,Brussels Capital Region1,2,3India,Spain,Belgium
MarketingSan Francisco|Phoenix|Boulder|Boston|ParisCA,AZ,CO,MA,Île-de-Francea,b,c,d,eUS,US,US,US,FR

 

 

Input data format.PNG

 

Output Table:

Output data format.PNG

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@talbi ,

You can use a combination of the following:

Split Columns by Delimiter.  For the Cities column you would use "|", and for the others use ",".

Once Split, you can use the Unpivot Columns to get the Columns into Rows.

rsbin_0-1687369026661.png

Then use Filters or other Flags to Remove the unnecessary rows.  Unfortunately, ran out of time to complete the entire manipulation, but hoping this at least gets you started.

Have attached pbix what I started.

EDIT:   Found a better way.  Attached is a revised pbix file.  Please refer to PQ (2).  Have only done it for Sales, but hope you can see the pattern to replicate the process.

 

Kind Regards,

 

View solution in original post

1 REPLY 1
rsbin
Super User
Super User

@talbi ,

You can use a combination of the following:

Split Columns by Delimiter.  For the Cities column you would use "|", and for the others use ",".

Once Split, you can use the Unpivot Columns to get the Columns into Rows.

rsbin_0-1687369026661.png

Then use Filters or other Flags to Remove the unnecessary rows.  Unfortunately, ran out of time to complete the entire manipulation, but hoping this at least gets you started.

Have attached pbix what I started.

EDIT:   Found a better way.  Attached is a revised pbix file.  Please refer to PQ (2).  Have only done it for Sales, but hope you can see the pattern to replicate the process.

 

Kind Regards,

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.